-
Notifications
You must be signed in to change notification settings - Fork 27
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(js): add EszipError
type
#92
base: main
Are you sure you want to change the base?
Conversation
This already has a number of merge conflicts. |
This commit adds a new error type that is returned from the JS API. It has fields to describe the location (specifier + line + col) of an error, in addition to storing the error message.
78ccefa
to
17affaa
Compare
Originally based off the wrong branch - fixed now. |
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.
LGTM after some fixes.
message: String, | ||
specifier: Option<String>, | ||
line: Option<usize>, | ||
column: Option<usize>, |
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.
If there's a line, then there's a column so these could be combined to be behind a single Option
to make it easier for consumers.
struct EszipError { | ||
message: String, | ||
specifier: Option<String>, | ||
line: Option<usize>, |
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.
Maybe add a doc saying what kind of indexes the line and column are. I believe the line is 1-indexed and column is 1-indexed character index (not byte)?
This commit adds a new error type that is returned from the JS API. It
has fields to describe the location (specifier + line + col) of an
error, in addition to storing the error message.