Skip to content

Commit

Permalink
Attempt to fix failing test in github check
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswilty committed Apr 25, 2024
1 parent 0befc1c commit b558eea
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions frontend/src/service/documentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,26 @@ function fetchDocument({
signal,
fileLoaderComplete,
}: FileLoaderFuncProps) {
void get(documentURI, { signal })
.then((response) =>
response.blob().then((blob) => {
const fileReader = new FileReader();
fileReader.addEventListener('loadend', () => {
fileLoaderComplete(fileReader);
});
fileReader.readAsText(blob);
// prettier-ignore
void (
get(documentURI, { signal })
.then((response) =>
response.blob().then((blob) => {
const fileReader = new FileReader();
fileReader.addEventListener('loadend', () => {
fileLoaderComplete(fileReader);
});
fileReader.readAsText(blob);
})
)
.catch((reason: unknown) => {
// Aborted requests are OK if using AbortController / AbortSignal
if (!(reason instanceof DOMException) || reason.name !== 'AbortError') {
// In all other cases release the error, to be handled downstream
throw reason;
}
})
)
.catch((reason: unknown) => {
// Aborted requests are OK if using AbortController / AbortSignal
if (!(reason instanceof DOMException) || reason.name !== 'AbortError') {
// In all other cases release the error, to be handled downstream
throw reason;
}
});
);
}

export { fetchDocument, getDocumentMetas };

0 comments on commit b558eea

Please sign in to comment.