Skip to content

Commit 3431a7c

Browse files
committed
fix edge case uncaught exception I saw in prod in a project log
1 parent f458336 commit 3431a7c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/packages/project/sync/server.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,15 @@ class SyncTableChannel {
393393
return;
394394
}
395395
this.log("check_if_should_save_or_close: save to disk if possible");
396-
await this.save_if_possible();
396+
try {
397+
await this.save_if_possible();
398+
} catch (err) {
399+
// the name "save if possible" suggests this should be non-fatal.
400+
this.log(
401+
"check_if_should_save_or_close: WARNING: unable to save -- ",
402+
err,
403+
);
404+
}
397405
const { n } = this.num_connections ?? {};
398406
this.log("check_if_should_save_or_close", { n });
399407
if (!this.persistent && n === 0) {

0 commit comments

Comments
 (0)