diff --git a/app/assets/javascripts/UIModels/AppState/FilesState.ts b/app/assets/javascripts/UIModels/AppState/FilesState.ts index aad700e3a..ddf6bda05 100644 --- a/app/assets/javascripts/UIModels/AppState/FilesState.ts +++ b/app/assets/javascripts/UIModels/AppState/FilesState.ts @@ -34,7 +34,7 @@ export class FilesState { const decryptedBytesArray: Uint8Array[] = [] - await this.application.files.downloadFile(file, async (decryptedBytes, progress) => { + const result = await this.application.files.downloadFile(file, async (decryptedBytes, progress) => { if (isUsingStreamingSaver) { await saver.pushBytes(decryptedBytes) } else { @@ -51,6 +51,10 @@ export class FilesState { } }) + if (result instanceof ClientDisplayableError) { + throw new Error(result.text) + } + if (isUsingStreamingSaver) { await saver.finish() } else {