Commit 2bc111c1 authored by Robert Knight's avatar Robert Knight

Implement reporting of unexpected errors during sidebar injection

This also fixes an issue with incorrect subclassing of
the base Error type in errors.js
parent 27e3c96c
...@@ -47,8 +47,24 @@ function angularModule() { ...@@ -47,8 +47,24 @@ function angularModule() {
return angular.module('ngRaven'); return angular.module('ngRaven');
} }
/**
* Report an error to Sentry.
*
* @param {string} context - A string describing the context in which
* the error occurred.
* @param {Error} error - An error object describing what went wrong
*/
function report(context, error) {
Raven.captureException(error, {
extra: {
context: context,
},
});
}
module.exports = { module.exports = {
init: init, init: init,
angularModule: angularModule, angularModule: angularModule,
setUserInfo: setUserInfo, setUserInfo: setUserInfo,
report: report,
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment