-
-
Notifications
You must be signed in to change notification settings - Fork 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
feat: improve errors #61
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.
Awesome stuff, just few remarks
PR description should clearly indicate that new version will no longer support types like ParserErrorNoJS
and ParserErrorUnsupportedVersion
and what use in exchange. This is a breaking change and it would be explained what is replacement so when people go to this PR from release notes, they do not have to read the code.
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.
I like it a lot ❤️
approved
Thanks! 🚀 |
🎉 This PR is included in version 0.17.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Improves the information provided by errors. It has several improvements:
Examples
Validation error
The document is not valid JSON nor YAML (YAML in this case)
A $ref couldn't be resolved
How to migrate
This PR introduces a breaking change. The error classes
PaserErrorNoJS
andParserErrorUnsupportedVersion
don't exist anymore. Instead, we only have a singleParserError
class and you can guess the type of the error by looking at thetype
field of the it.ParserErrorNoJS
Before:
Now:
ParserErrorUnsupportedVersion
Before:
Now:
and
ParserError
Before:
Now:
Different
ParserError
errors with differenttype
fields to make it easier to identify the kind of message. For more information, see README.md.