I've rewritten a web application using angular. But now i have the problem that it's not as easy as window.onerror = function(...) { ... }
to send clientside errors to the server. But this is really helpful to detect errors.
I added a custom exception handler to angular using the following code
$provide.decorator("$exceptionHandler", function($delegate) {
return function(exception, cause) {
$delegate(exception, cause);
log2server(exception + " (" + cause + ")");
};
});
But this wont allow me to get the location where the exception came from. Any hints/experience how to tackle this? I would also love a solution which is able to work with http://stacktracejs.com/