Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
53
rated 0 times [  55] [ 2]  / answers: 1 / hits: 26138  / 10 Years ago, fri, june 13, 2014, 12:00:00

In my application I am using a REST api to get my data.
If a send a request like this



$http.get('api/entity/' + $scope.entityId).success(/* DO STUFF */).error(/* DO STUFF */)


In the service, if the entityId does not exist I return a 404.
In the error function I catch it using the status (second parameter) and act on it in a proper way.



I'm being annoyed by the fact that angular if throwing an exception and pollutes the javascript console. It seem to happen on Angular.js:8165



It there any way to tell angular that I'm a grown up developer and I will handle what he sees as an error myself in a nice way?



In other words, can I tell angular to not output that crap?



Thanks,


More From » angularjs

 Answers
6

This is your browser's functionality, and not a part of AngularJS that does the logging. Here's a sample from the console of this page:



console



You can see it logs the exact same error message as you linked in the question's comment, and is indeed pointing to a part in the source code, but I didn't add any logging statements.



The best thing you can do is follow this answer and add a filter to the console.


[#70583] Wednesday, June 11, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ulysses

Total Points: 111
Total Questions: 118
Total Answers: 113

Location: Zambia
Member since Sat, Oct 31, 2020
4 Years ago
;