// Add this to your main angular file.
// add the logger and embed it into the app
var logger = new RC.Logger({
applicationId : 'c31c335ef37283c451b18ba0dd317de1',
recordUserActions : true,
recordSessionVideo : true,
maxNbrOfReportedErrors : 1,
logResourceLoadFailures : true,
logAjaxRequests : true,
captureScreenshot : true,
onErrorLogged: window.onErrorLogged,
newErrorText: 'An error was caught and successfully logged, id #{id}',
showNotificationOnError : true,
user : {
name : 'Dan Anderson',
email : 'demouser@therootcause.io',
imgUrl : 'https://s.gravatar.com/avatar/0b9e04aed9dcc2d3a121522147dfc7fa?s=80'
}
});
// Assuming that an app is your main module
// var app = angular.module('tutorialWebApp', [
// 'ngRoute'
// ]);
app.config(function($provide) {
$provide.decorator('$exceptionHandler', ['$log', '$delegate',
function($log, $delegate) {
return function(exception, cause) {
logger.logException(exception, {
data: { cause: cause }
});
$delegate(exception, cause);
};
}
]);
});
RootCause | Angular demo