2
Reply

How to Log uncaught AngularJS errors to the backend?

Santosh Kumar Adidawarpu

Santosh Kumar Adidawarpu

Feb 11, 2017
1.1k
0

    The example below will overwrite the default $exceptionHandler in order to log uncaught errors to the backend for later inspection by the developers using $log.warn() instead of $log.error(). angular.module('exceptionOverwrite', []).factory('$exceptionHandler', ['$log', 'logErrorsToBackend', function($log, logErrorsToBackend) {return function customExcHandler(excp, cause) {logErrorsToBackend(excp, cause);$log.warn(excp, cause);};}]);

    Santosh Kumar Adidawarpu
    February 11, 2017
    2

    in the browser , where u r executing your project, press f12 u will get to know the error coming in your code also where they r comin

    Sakshi Mahajan
    May 29, 2017
    0