-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Refactor error handling #5206
Refactor error handling #5206
Conversation
🦋 Changeset detectedLatest commit: 6c6a182 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
}, | ||
}); | ||
|
||
// Vite will handle creating the frame for us with proper line numbers, no need to create one |
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 took me by surprise while writing this PR, it turns out that Vite is able to create codeframes by itself whenever an error happens in parts it understands
Sometimes they're better than ours, sometimes not, luckily it checks if we already have one before doing it, so we can case by case it
This reverts commit 5ca34f3.
Changes
This is a refactor of our error handling intended to bring the actual error handling closer to where the error actually happen instead of downstream.
The ideas being that by the different parts that can cause errors being more isolated, they'll be easier to test individually, it'll be easier to provide as much information as possible to users and eventually, will be easier to recover from (since we can know exactly what happened and where)
An easy example of the benefits is error code support, since we know precisely where the error happened, it's easy to apply a specific error code
This is the first part of a series of PRs and back-and-forth about errors, at the end of it, I'm hoping we'll have awesome and stylish errors!
Fix #5149
Fix #5153
Fix #5154
Testing
Our current error tests all pass!
Docs
N/A