Skip to content

[Breaking] Use error object #98

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

Draft
wants to merge 2 commits into
base: fix/error-type
Choose a base branch
from

Conversation

joshpensky
Copy link
Contributor

@joshpensky joshpensky commented Sep 14, 2021

Description

Previously, we only ever surfaced the error message. As pointed out by #44, we should return the full object instead of just the message! That way the user can have full context of their errors when rendering the error page

This is a breaking change and should be released with 2.0.0

Related issues

Builds on top of #84 to resolve #44

What this does

  • Removes RouteError type in favor of unknown (since we don't know what kind of error is thrown!)
  • Update route error state management in Guard component
  • Updates intermediate demo + docs example to use instanceof Error check

How to test

  1. Visit a Missingno page on the deployed app (e.g., /test)
  2. Confirm the error message still appears as expected

@joshpensky joshpensky added the enhancement New feature or request label Sep 14, 2021
@joshpensky joshpensky self-assigned this Sep 14, 2021
@joshpensky joshpensky marked this pull request as draft September 16, 2021 15:29
@joshpensky joshpensky mentioned this pull request Sep 16, 2021
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant