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

1.0.0-beta.1 Excess error log in stateService.ts #2860

Closed
tianweiliu opened this issue Jul 6, 2016 · 2 comments
Closed

1.0.0-beta.1 Excess error log in stateService.ts #2860

tianweiliu opened this issue Jul 6, 2016 · 2 comments
Labels

Comments

@tianweiliu
Copy link

tianweiliu commented Jul 6, 2016

1.0.0-beta.1
stateService.ts?6000:488

are the following console logs necessary?

/** @hidden */
  private _defaultErrorHandler: ((_error) => void) = function $defaultErrorHandler($error$) {
    if ($error$ instanceof Error && $error$.stack) {
      console.error($error$.stack);
    } else if ($error$ instanceof Rejection) {
      console.error($error$);
      if ($error$.detail && $error$.detail.stack)
        console.error($error$.detail.stack);
    } else {
      console.error($error$);
    }
  };
@tianweiliu tianweiliu changed the title Excess error log in stateService.ts 1.0.0-beta.1 Excess error log in stateService.ts Jul 6, 2016
@christopherthielen
Copy link
Contributor

The default error handler is there to handle any uncaught exceptions in transitions. By default, it logs to the console. You can provide a noop implementation by calling:

StateService.defaultErrorHandler(function() {});

See: https://ui-router.github.io/docs/latest/classes/state.stateservice.html#defaulterrorhandler

@tianweiliu
Copy link
Author

@christopherthielen thanks for the explanation! I will mark this ticket as closed.

christopherthielen added a commit that referenced this issue Aug 11, 2016
feature(hooks): Pass ignored (synchronous success/error) hook exceptions to the `defaultErrorHandler`
test(*): Silence error logging in unit tests

Partially addresses #2860
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants