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 error codes to all throws clauses #415

Open
LeaVerou opened this issue Feb 9, 2024 · 0 comments
Open

Add error codes to all throws clauses #415

LeaVerou opened this issue Feb 9, 2024 · 0 comments
Labels
enhancement New feature or request Topic: JS API

Comments

@LeaVerou
Copy link
Member

LeaVerou commented Feb 9, 2024

Currently we throw errors with just an error message (example). This means that apps using Color.js only have two real options: catching all errors and just indicating that something went wrong, or passing the actual message string on to the user.

I think we can use the cause property to pass in more structured data, including an error code. If so, it would be good to do this across the codebase.

@LeaVerou LeaVerou added enhancement New feature or request Topic: JS API labels Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Topic: JS API
Projects
None yet
Development

No branches or pull requests

1 participant