Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat(js): add EszipError type #92

wants to merge 1 commit into from

Conversation

lucacasonato
Copy link
Member

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.

@cjihrig
Copy link

cjihrig commented Sep 26, 2022

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.
@lucacasonato
Copy link
Member Author

This already has a number of merge conflicts.

Originally based off the wrong branch - fixed now.

Copy link
Member

@dsherret dsherret left a 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>,
Copy link
Member

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>,
Copy link
Member

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)?

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.

3 participants