This has the side effect of loosing the stack trace if I break on "uncaught exceptions", and breaking on "all exceptions" is absolutely no option, since many frameworks use the exception handling as mechanisms of detecting various features of the browser environment.
Thus I came up with this pattern:
So if an exception happens, I can still break on all exceptions, but also get my log right.
Can you imagine how cool it would be to chain exceptions like in Java? For example:
At least we can dream about it, and appreciate more languages that do offer chaining of exceptions.