Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Improve feedback from squelched exceptions #27

Closed
sjmiles opened this issue Sep 9, 2013 · 1 comment
Closed

Improve feedback from squelched exceptions #27

sjmiles opened this issue Sep 9, 2013 · 1 comment

Comments

@sjmiles
Copy link
Contributor

sjmiles commented Sep 9, 2013

https://github.com/Polymer/observe-js/blob/master/src/observe.js#L367

There is more information available on ex then console.error emits to the console.

Changing it to something like this:

        console.error('Exception caught during observer callback: ', ex.stack || ex);

Gives a lot more useful information, on Chrome at least.

I didn't make a pull request because I didn't do any due diligence other than throw that change into my local checkout. I don't know what this does on any other browser, e.g., and I suspect Arv knows a lot about this topic.

@arv: btw, SD Polyfill has a similar issue where it rethrows a squelched error which loses the stack information. It could use the same treatment.

@ghost ghost assigned rafaelw Sep 9, 2013
@sjmiles
Copy link
Contributor Author

sjmiles commented Sep 11, 2013

Fwiw, this seems to work as well on Chrome and might be better across platforms (only difference is one argument to console.error instead of two):

 console.error('Exception caught during observer callback: ' + (ex.stack || ex));

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants