Skip to content

fix: propagate original error #160

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

Merged
merged 2 commits into from
Aug 10, 2023

Conversation

WrathOfZombies
Copy link
Contributor

What:

Per the conversation in #159, it would be great if we propagated the original error, when no type of fallback is provided. This PR addresses that.

Additionally I opted to log a console.error to guide the developer in understanding the issue. Unsure if this affects react server components in any way.

How:

Just threw the original error back.

The one potential breaking change here is that there's no longer an expectation that this component throws an Error type as the error itself could be anything.

Checklist:

  • Documentation - N/A
  • Tests - Validated
  • Ready to be merged

Sorry, something went wrong.

@bvaughn
Copy link
Owner

bvaughn commented Aug 10, 2023

Re-throwing the original error makes sense! ✅

I think the console.error logging should only be done in development though, so I've updated the PR.

WrathOfZombies and others added 2 commits August 10, 2023 08:48

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@bvaughn bvaughn force-pushed the fix/propagate-original-error branch from bdff678 to 7763743 Compare August 10, 2023 18:48
@bvaughn bvaughn merged commit 8b2c6c5 into bvaughn:master Aug 10, 2023
@5punk
Copy link

5punk commented Aug 12, 2023

Thank you!~

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

3 participants