I am trying to handle my Application errors by extending $exceptionHandler
, with respect to that I registered a provider like below:
app.provider("$exceptionHandler", function() {
return function(exception, cause) {
// here I want to get the Controller which thrown the error
}
});
Is there a way we can find it out?
Update:
In general I want to show a custom error message only for a section (particular scope in my html
) which throws an exception. Is there a better way to handle this case generically
For e.g. "Data Unavailable"
or "Unknown Error occurred"