We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e0230ed commit 360e39eCopy full SHA for 360e39e
src/index.ts
@@ -100,7 +100,17 @@ const run = async () => {
100
toastMessage += ` - to note '${matchingNote.title}'`;
101
}
102
await showMessage(ToastType.Info, toastMessage);
103
- const sn = new SupernoteX(await readFileToUint8Array(fullPathOfNoteFile));
+ let sn: SupernoteX;
104
+ try {
105
+ sn = new SupernoteX(await readFileToUint8Array(fullPathOfNoteFile));
106
+ } catch (e) {
107
+ const errorMessage = `could not parse '${fullPathOfNoteFile}'`
108
+ await showMessage(ToastType.Error, errorMessage)
109
+ console.error(errorMessage)
110
+ console.error(e)
111
+ continue
112
+ }
113
+
114
let noteContent = "";
115
for (const page of sn.pages) {
116
if (page.paragraphs.trim().length > 0) {
0 commit comments