Skip to content

Commit

Permalink
Merge pull request #183 from cool-RR/patch-1
Browse files Browse the repository at this point in the history
Fix exception cause in reader.py
  • Loading branch information
MSeal committed Jun 14, 2020
2 parents a523c71 + 4711720 commit dfb2696
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nbformat/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ def parse_json(s, **kwargs):
"""Parse a JSON string into a dict."""
try:
nb_dict = json.loads(s, **kwargs)
except ValueError:
except ValueError as e:
# Limit the error message to 80 characters. Display whatever JSON will fit.
raise NotJSONError(("Notebook does not appear to be JSON: %r" % s)[:77] + "...")
raise NotJSONError(("Notebook does not appear to be JSON: %r" % s)[:77] + "...") from e
return nb_dict

# High level API
Expand Down

0 comments on commit dfb2696

Please sign in to comment.