Skip to content

Commit

Permalink
catch any exceptions when creating a note
Browse files Browse the repository at this point in the history
  • Loading branch information
marph91 committed Oct 4, 2024
1 parent 8310641 commit 838189e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,11 @@ def import_notebook(self, notebook: imf.Notebook):
# Don't overwrite existing suffices.
if note.path.suffix != ".md":
note.path = note.path.with_suffix(note.path.suffix + ".md")
self.import_note(note)
try:
self.import_note(note)
except Exception as exc: # pylint: disable=broad-except
LOGGER.error(f'Failed to write note "{note.title}"')
LOGGER.debug(exc, exc_info=True)
for child_notebook in notebook.child_notebooks:
child_notebook.path = notebook.path / safe_path(child_notebook.title)
self.import_notebook(child_notebook)
Expand Down

0 comments on commit 838189e

Please sign in to comment.