-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
fix: ensure that errorParser always returns something #20749
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to see this change go through, mind adding a test to confirm its use?
Could we maybe change our |
583d715
to
4d109ab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! Thank you!
Additionally on top of fixing non-error throws - it also restores stack trace that was missing recently (err
was assigned string so error: err instanceof Error ? err : undefined
was always undefined)
Published in |
Description
api-runner-node
assumes thatapi-runner-error-parser
always returns something. (https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/utils/api-runner-node.js#L381-L411)gatsby-plugin-manifest
)This makes
api-runner-error-parser
a bit more robust by returning a default error if we didn't manage to parse it.I'll fix the
gatsby-plugin-manifest
in another PR