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

Improve error handling #187

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

azzzy
Copy link

@azzzy azzzy commented Jun 1, 2024

When JSON Hero fails to fetch a json for some reason it throws an error, which is outside of any catch/error boundary.
In this case safeFetch returns a response with HTTP status 520 send from the remote server.

Screenshot 2024-06-01 at 16 24 16

The first commit fixes this problem:
fix: don't try to access the title if doc is undefined

The second adds the display of the actual errors coming from safeFetch:
fix: show the fetch errors when thrown, instead of hardcoded 404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant