Skip to content

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.

4 participants