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

Chore: Error => TypeError #9390

Merged
merged 2 commits into from Oct 6, 2017
Merged

Conversation

aladdin-add
Copy link
Member

@aladdin-add aladdin-add commented Oct 4, 2017

What is the purpose of this pull request? (put an "X" next to item)

[x] Other, please explain:
throw a TypeError after a type checking if-statement, instead of a generic Error.

What changes did you make? (Give an overview)

Is there anything you'd like reviewers to focus on?

@eslintbot
Copy link

LGTM

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for contributing!

@@ -160,7 +160,7 @@ function tryParseSelector(rawSelector) {
return esquery.parse(rawSelector.replace(/:exit$/, ""));
} catch (err) {
if (typeof err.offset === "number") {
throw new Error(`Syntax error in selector "${rawSelector}" at position ${err.offset}: ${err.message}`);
throw new TypeError(`Syntax error in selector "${rawSelector}" at position ${err.offset}: ${err.message}`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a TypeError semantically correct here (as opposed to, e.g. a SyntaxError)? This error doesn't seem to relate to types.

@eslintbot
Copy link

LGTM

@not-an-aardvark not-an-aardvark added the chore This change is not user-facing label Oct 5, 2017
@not-an-aardvark not-an-aardvark merged commit c581b77 into eslint:master Oct 6, 2017
@aladdin-add aladdin-add deleted the type-error branch October 6, 2017 10:08
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Apr 5, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Apr 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion chore This change is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants