Skip to content

Commit

Permalink
♻️ isolate fs.write in try-catch
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler-dot-earth committed Sep 12, 2024
1 parent 196ebd3 commit 9b54fd4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,6 @@ export default class ReadwisePlugin extends Plugin {
contentToSave = existingContent + contents;
}
await this.fs.write(originalName, contentToSave);
await this.removeBooksFromRefresh([bookID]);
await this.removeBookFromFailedBooks([bookID]);
} catch (e) {
console.log(`Readwise Official plugin: error writing ${processedFileName}:`, e);
this.notice(`Readwise: error while writing ${processedFileName}: ${e}`, true, 4, true);
Expand All @@ -376,6 +374,9 @@ export default class ReadwisePlugin extends Plugin {
}
// communicate with readwise?
}

await this.removeBooksFromRefresh([bookID]);
await this.removeBookFromFailedBooks([bookID]);
}
await this.saveSettings();
}
Expand Down

0 comments on commit 9b54fd4

Please sign in to comment.