kriskowal/q — pull request #94 by ef4 (2012-07-29 01:11:32+00:00)
Title: Add optional global error trap

Sometimes window.onerror is just not good enough. For example, under
Chrome you lose your stack trace.

This exposes a new function on Q that lets you set a global error
handler, which is called whenever Q.end() would have otherwise generated an
unhandled exception. Example usage:

````javascript
Q.onError(function(err){
// Post your error to the server...
});
````

Note that if you still want the unhandled exception too (which is helpful in the console), you can just make your onError handle rethrow.