Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: log attachment on failure

Abdullah Atta38e2250fd19a
diff --git a/apps/web/src/utils/streams/attachment-stream.ts b/apps/web/src/utils/streams/attachment-stream.ts
index 0b6205a31..e41fa56ed 100644
--- a/apps/web/src/utils/streams/attachment-stream.ts
+++ b/apps/web/src/utils/streams/attachment-stream.ts
@@ -43,16 +43,15 @@ export class AttachmentStream extends ReadableStream<ZipFile> {
super({
start() {},
async pull(controller) {
- try {
- if (signal?.aborted) {
- controller.close();
- return;
- }
-
- onProgress && onProgress(index);
- const attachment = await resolve(ids[index++]);
- if (!attachment) return;
+ if (signal?.aborted) {
+ controller.close();
+ return;
+ }
+ onProgress && onProgress(index);
+ const attachment = await resolve(ids[index++]);
+ if (!attachment) return;
+ try {
if (
!(await db
.fs()
@@ -87,7 +86,7 @@ export class AttachmentStream extends ReadableStream<ZipFile> {
);
}
} catch (e) {
- console.error(e);
+ console.error(e, attachment);
showToast("error", (e as Error).message);
} finally {
if (index === ids.length) {