angular-loading-bar
angular-loading-bar copied to clipboard
Error message when loading malformed JSON
Hi - I am using anuglar loadbar in my app and its brilliant.
I have one issue though, if I ever try to load a malformed json via http request, I get an error message in my log that looks like the below.... the problem is that I have no way of identifying where the error is coming from... which piece of code ran the http request and which file was being loaded... Is there some way to configure angular-loading-bar to give me that info in the error messages? Something to do with the interceptor (i dont really know if it applies)
11:49:09.622 angular.js:14362 SyntaxError: Unexpected token U in JSON at position 0
at JSON.parse (<anonymous>)
at fromJson (http://localhost:8080/bower_components/angular/angular.js:1377:14)
at defaultHttpResponseTransform (http://localhost:8080/bower_components/angular/angular.js:11025:16)
at http://localhost:8080/bower_components/angular/angular.js:11116:12
at forEach (http://localhost:8080/bower_components/angular/angular.js:357:20)
at transformData (http://localhost:8080/bower_components/angular/angular.js:11115:3)
at transformResponse (http://localhost:8080/bower_components/angular/angular.js:11936:21)
at processQueue (http://localhost:8080/bower_components/angular/angular.js:16689:37)
at http://localhost:8080/bower_components/angular/angular.js:16733:27
at Scope.$eval (http://localhost:8080/bower_components/angular/angular.js:18017:28) Possibly unhandled rejection: {}
(anonymous) @ angular.js:14362
(anonymous) @ angular.js:10859
processChecks @ angular.js:16715
$eval @ angular.js:18017
$digest @ angular.js:17827
$apply @ angular.js:18125
done @ angular.js:12233
completeRequest @ angular.js:12459
requestLoaded @ angular.js:12387
11:49:09.625 angular.js:14362 Broken interceptor detected: Config object not supplied in rejection:
https://github.com/chieffancypants/angular-loading-bar/pull/50
(anonymous) @ angular.js:14362
responseError @ loading-bar.js:135
processQueue @ angular.js:16689
(anonymous) @ angular.js:16733
$eval @ angular.js:18017
$digest @ angular.js:17827
$apply @ angular.js:18125
done @ angular.js:12233
completeRequest @ angular.js:12459
requestLoaded @ angular.js:12387
11:49:09.684 angular.js:14362 Broken interceptor detected: Config object not supplied in rejection:
https://github.com/chieffancypants/angular-loading-bar/pull/50
(anonymous) @ angular.js:14362
responseError @ loading-bar.js:135
processQueue @ angular.js:16689
(anonymous) @ angular.js:16733
$eval @ angular.js:18017
$digest @ angular.js:17827
$apply @ angular.js:18125
done @ angular.js:12233
completeRequest @ angular.js:12459
requestLoaded @ angular.js:12387
11:49:09.687 angular.js:14362 Broken interceptor detected: Config object not supplied in rejection:
https://github.com/chieffancypants/angular-loading-bar/pull/50
(anonymous) @ angular.js:14362
responseError @ loading-bar.js:135
processQueue @ angular.js:16689
(anonymous) @ angular.js:16733
$eval @ angular.js:18017
$digest @ angular.js:17827
$apply @ angular.js:18125
done @ angular.js:12233
completeRequest @ angular.js:12459
requestLoaded @ angular.js:12387
11:49:09.689 angular.js:14362 Broken interceptor detected: Config object not supplied in rejection:
https://github.com/chieffancypants/angular-loading-bar/pull/50
(anonymous) @ angular.js:14362
responseError @ loading-bar.js:135
processQueue @ angular.js:16689
(anonymous) @ angular.js:16733
$eval @ angular.js:18017
$digest @ angular.js:17827
$apply @ angular.js:18125
done @ angular.js:12233
completeRequest @ angular.js:12459
requestLoaded @ angular.js:12387
11:49:09.701 angular.js:14362 Broken interceptor detected: Config object not supplied in rejection:
https://github.com/chieffancypants/angular-loading-bar/pull/50
(anonymous) @ angular.js:14362
responseError @ loading-bar.js:135
processQueue @ angular.js:16689
(anonymous) @ angular.js:16733
$eval @ angular.js:18017
$digest @ angular.js:17827
$apply @ angular.js:18125
done @ angular.js:12233
completeRequest @ angular.js:12459
requestLoaded @ angular.js:12387
11:49:09.724 angular.js:14362 Broken interceptor detected: Config object not supplied in rejection: