I suggest you ...

Integration with AngularJS

It seems that Errorception is not able to report errors that occur within an AngularJS digest cycle. You can see the error reports in the JS console, but not in Errorception dashboard.

1 vote
Vote
Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
You have left! (?) (thinking…)
Saurabh Nanda shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

4 comments

Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
Submitting...
  • Sebastian commented  ·   ·  Flag as inappropriate

    Yes AngulaJS catch all errors and handle them with $exceptionHandler service where the default action is to log them on the console. You need something like this to post errors to errorception:

    instantWinGameApp.config(function($provide) {
    $provide.decorator("$exceptionHandler", [
    "$delegate",
    function($delegate, $injector) {
    return function (exception, cause) {
    _errs.push(exception instanceof Error ? exception : new Error(exception));
    $delegate(exception, cause);
    };
    }]);
    });

  • AdminRakesh Pai (Founder, Errorception) commented  ·   ·  Flag as inappropriate

    Hey. Sorry for the late reply.

    _errs.push should work fine. That hasn't been affected by the CDN move and corresponding loading change.

    Can you please confirm if you are calling 'throw e' right after you call _errs.push(e); ?

  • Saurabh Nanda commented  ·   ·  Flag as inappropriate

    I've over-ridden Angular's exception handler and am calling _errs.push(exception) at the appropriate place. However in the console, I can see a POST to errorception and a log message -- "posted 0 errors to errorception"

    The output of the following debugging statement from within the exception handler is given below it.

    DEBUG STATEMENT: console.log('inside the exception handler', exception, typeof(exception), exception.constructor);

    OUTPUT:
    [22:34:44.027] inside the exception handler (new ReferenceError("toHumanCurrency2 is not defined", "http://localhost:3000/assets/admin/vl/common/currency_input.js?body=1", 30)) object function ReferenceError() {
    [native code]
    }

  • Saurabh Nanda commented  ·   ·  Flag as inappropriate

    Rakesh, after your recent tweak to the erroception loading code, can one still use _errs.push(exception)? Basically, is _errs object still available in the global scope?

Feedback and Knowledge Base