Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only add ellipsis to NotJSONError message if message is truncated #344

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

rschroll
Copy link
Contributor

In almost all cases, it will be truncated, but in the few cases that parse_json is called with short invalid inputs, this prevents confusion about what actually got passed in.

Specifically, I ran into a case where nbformat was getting an empty string, rather than a valid JSON string, which produced the message

Notebook does not appear to be JSON: ''...
which wrongly implies there is more to the input than there was.

It's a minor issue for sure, but I was poking around here anyway, so I thought I'd fix it.

In almost all cases, it will be truncated, but in the few cases that
parse_json is called with short invalid inputs, this prevents
confusion about what actually got passed in.
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@blink1073 blink1073 enabled auto-merge (squash) January 13, 2023 13:20
@blink1073 blink1073 merged commit 5fc0e8d into jupyter:main Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants