Skip to content

Commit

Permalink
Added console log for error
Browse files Browse the repository at this point in the history
  • Loading branch information
daledesilva committed Jul 9, 2023
1 parent bea2599 commit 87615f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/logic/import-logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@ async function importJson(vault: Vault, folder: TFolder, file: File, settings: P
let content: KeepJson | undefined;
try {
content = JSON.parse(readerEvent.target.result as string) as KeepJson;
} catch {
} catch(e) {
console.log(e);
result.logStatus = LogStatus.Error;
result.details = `<p>JSON file appears to be malformed and can't be imported. You can open this file and either attempt to correct and reimport it, or to copy it's contents manually.</p>
<p><a href="https://www.toptal.com/developers/json-formatter">Toptal JSON Formatter</a> can help to find errors and format JSON data for easier manual copying. Open the file in a text editor (or drag it into a browser tab), to copy the contents into the formatter.</p>`;
Expand Down

0 comments on commit 87615f2

Please sign in to comment.