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

Clarify roles of Debug.exception and Debug.warn #109

Open
karger opened this issue Aug 18, 2013 · 0 comments
Open

Clarify roles of Debug.exception and Debug.warn #109

karger opened this issue Aug 18, 2013 · 0 comments

Comments

@karger
Copy link
Contributor

karger commented Aug 18, 2013

Exhibit has two Debugging functions, Debug.exception and Debug.warn . Exception throws an error (halting execution) while warn writes to the console if it exists and raises an alert if it does not. So it seems warn is intended for less severe errors. However, there doesn't seem to be a lot of consistency in deciding which errors are severe. For example, an error initializing a single exhibit component causes an exception to be thrown, even though all other components might initialize just fine. On the other hand, if a component has no createFromDOM method, then a warning is given (but no exception).

A clear specification of when to except and when to warn would allow us to move the code towards consistent usage.

We should also consider that when an end user is viewing the page, neither halting on exceptions nor (alert) warnings are useful to them; in such situations we should suppress warnings and also catch all errors so the user gets at least the working parts of the exhibit.

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

1 participant