Tuesday, 15 February 2011

javascript - Readable Angular.js Errors? -



javascript - Readable Angular.js Errors? -

angular.js not provide human-readable error messages default.

is there anyway alter default, cryptic angular.js exception url more readable error message? is, have re-create url, remove prefix, , paste in browser see problem is.

for example, transforming next exception more useful error message:

error: [ng:areq] http://errors.angularjs.org/1.3.0/ng/areq?p0=interfacecontroller&p1=not%20a%20function%2c%20got%20undefined y/<@https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0/angular....

to like:

"missing required argument interfacecontroller"

i know can provide own exception handler:

.factory('$exceptionhandler', function () { homecoming function errorcatcherhandler(exception, cause) { console.error(exception); }; });

am approaching wrong?

the problem was developing against minified/compressed version (assuming other js libraries). uncompressed version includes readable error message.

https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0/angular.min.js https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0/angular.js

javascript angularjs

No comments:

Post a Comment