Skip to content

Commit

Permalink
fix: catch any uncaught promises up the chain that could be thrown if…
Browse files Browse the repository at this point in the history
… there is a fatal error with the request
  • Loading branch information
iOvergaard committed Oct 16, 2024
1 parent 36ee565 commit 4f6fc30
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ export class UmbTemporaryFileManager<
for (const item of queue) {
if (!item.temporaryUnique) throw new Error(`Unique is missing for item ${item}`);

const { error } = await this.#temporaryFileRepository.upload(item.temporaryUnique, item.file);
//await new Promise((resolve) => setTimeout(resolve, (Math.random() + 0.5) * 1000)); // simulate small delay so that the upload badge is properly shown
const { error } = await this.#temporaryFileRepository
.upload(item.temporaryUnique, item.file)
.catch(() => ({ error: true }));

let status: TemporaryFileStatus;
if (error) {
Expand Down

0 comments on commit 4f6fc30

Please sign in to comment.