Skip to content

Instantly share code, notes, and snippets.

@amatiasq
Last active October 6, 2016 15:47
Show Gist options
  • Save amatiasq/9800465290f23488e199 to your computer and use it in GitHub Desktop.
Save amatiasq/9800465290f23488e199 to your computer and use it in GitHub Desktop.
Listen to Raygun errors from angular app
<script src="//cdn.raygun.io/raygun4js/raygun.min.js"></script>
<script>
Raygun.init('<TOKEN>', {
excludedHostnames: ['localhost'],
})
.attach()
.withCustomData(function() {
return {
hash: document.location.hash,
};
});
</script>
module.config(function($provide) {
$provide.decorator('$exceptionHandler', function($delegate) {
return function (exception, cause) {
window.Raygun.send(exception);
$delegate(exception, cause);
};
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment