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

Add workaround/fix for node v6 selector exception handling #1208

Closed
wants to merge 1 commit into from

Conversation

strarsis
Copy link
Contributor

@strarsis strarsis commented Jan 4, 2020

@GreLI: This PR adds a workaround/fix for selector exception handling in node v6.
This fixes the currently failing build of current master (Travis node v6): https://travis-ci.org/svg/svgo/jobs/623319182#L880

The reason is that in node v6 the constructor property of an exception that is thrown by css-select, when a selector doesn't match (which normally happens all the time), is just Error instead of SyntaxError. All exceptions other than SyntaxError are re-thrown, but when the constructor is just Error in node v6, one is unable to differentiate. As an alternative for node v6, the exception message is matched by the error message.

@strarsis strarsis changed the title Add workaround/fix for node v6 selector exception handling. Add workaround/fix for node v6 selector exception handling Jan 4, 2020
@TrySound
Copy link
Member

I'm dropping node 6 and 8 support now. This change is not necessary in v10+, right?

@strarsis
Copy link
Contributor Author

@TrySound: Right.

@strarsis strarsis closed this Feb 13, 2021
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.

2 participants