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

Request for better error message(s) #8

Closed
CAYdenberg opened this issue Apr 3, 2018 · 2 comments
Closed

Request for better error message(s) #8

CAYdenberg opened this issue Apr 3, 2018 · 2 comments

Comments

@CAYdenberg
Copy link
Contributor

If you pass an invalid color into invert you get

Uncaught TypeError: Cannot read property 'r' of null

which is hard to interpret, and doesn't give you much clue that the error is occurring in this package.

I'd be happy to contribute a PR if you're likely to merge it.

@CAYdenberg CAYdenberg changed the title Request for better error handling Request for better error message(s) Apr 3, 2018
@onury
Copy link
Owner

onury commented Apr 3, 2018

You're very welcome to send a PR.

If you ask me; the only line with a .r is within toRGB() method. I'd validate the c argument and throw "Invalid color value."

@onury
Copy link
Owner

onury commented Apr 5, 2018

v1.2.3 is released.

@onury onury closed this as completed Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants