Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messages throughout the framework #1041

Closed
IgorMinar opened this issue Jun 12, 2012 · 5 comments
Closed

Improve error messages throughout the framework #1041

IgorMinar opened this issue Jun 12, 2012 · 5 comments
Labels

Comments

@IgorMinar
Copy link
Member

@IgorMinar IgorMinar commented Jun 12, 2012

Our error messages are very inconsistent, often don't provide info info to debug the problem (because more info == more bytes) and at the same time take up a big chuck of our byte payload anyway.

How about we do the following:

  • introduce string interpolation so that our error messages can be easier to write:
    before: throw Error("Your " + foo + " did something stupid in " + bar))
    after: throw InterpolatedError("Your {foo} did something stupid in {bar}", foo, bar)

  • go through all error messages, unify them and ensure that they provide enough info for debugging purposes

  • introduce a new compilation pass (with closure compiler or uglify) that will either completely remove (where it makes sense) error messages for the production build or replace them with error codes:
    before: throw Error("Your " + foo + " did something stupid in " + bar))
    after in min.js build: throw Error('NG-323',f,b)

    we can then build a error code table to decipher production errors.

@ProLoser
Copy link
Contributor

@ProLoser ProLoser commented Nov 8, 2012

One of the things that I thought might help was logging the DOM element that causes some of the errors (such as when used in directives)

@abilashs90
Copy link

@abilashs90 abilashs90 commented Jul 16, 2013

Especially the $digest errors! Sometimes your are clueless as to what's happening!

@petebacondarwin
Copy link
Member

@petebacondarwin petebacondarwin commented Jul 16, 2013

See the minErr implementation in master.

On 16 July 2013 04:00, abilashs90 notifications@github.com wrote:

Especially the $digest errors! Sometimes your are clueless as to what's
happening!


Reply to this email directly or view it on GitHubhttps://github.com//issues/1041#issuecomment-21018437
.

@kfgodel
Copy link

@kfgodel kfgodel commented Dec 4, 2013

If you add error codes, please also maintain text description on every situation. Getting only a code it's a very painful.
Please consider as error and log any problem interpreting configuration files (services.js, controllers.js, etc). Sometimes a typo makes them useless and the JS console is empty.

@btford
Copy link
Contributor

@btford btford commented Dec 9, 2013

minErr has since implemented most of this. If there's some specific issue where a better error would be more helpful, feel free to file a new issue/PR for it. Thanks!

@btford btford closed this Dec 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.