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 an Error type #6

Open
dominikh opened this issue Sep 2, 2014 · 0 comments
Open

Add an Error type #6

dominikh opened this issue Sep 2, 2014 · 0 comments

Comments

@dominikh
Copy link
Owner

dominikh commented Sep 2, 2014

Add a type Error, which acts as a combination of DOMException and DOMError. It should be returned from methods such as (*HTMLInputElement).StepDown, which are documented to throw exceptions in case of abnormal conditions.

When we catch an exception that isn't of type DOMException¹, we should throw it again, as it's of a different nature.

We should also consider adding one variable per possible error type (e.g. InvalidStateError), so that one can check directly against those, instead of requiring more constants and comparing fields of Error to those.

Finally, find out whether all modern browsers have the name property, or if we need to implement a fallback that looks at code instead.

¹: Only DOMException will actually be thrown, DOMError is some internal name.
²: https://developer.mozilla.org/en-US/docs/Web/API/DOMError and https://developer.mozilla.org/en/docs/Web/API/DOMException will serve as guidance.

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

No branches or pull requests

1 participant