I already configured airbrake to report error but it seems it doesn't report http errors. Hence I'm trying to connfigure it to do so. Here's my factory:
import AirbrakeClient from 'airbrake-js';
export let errorHttpInterceptor = ($q, CONSTANT) => {
'use strict';
let airbrake = new AirbrakeClient({
projectId: CONSTANTS.AIRBRAKE_PROJECT_ID,,
projectKey: CONSTANTS.AIRBRAKE_PROJECT_KEY
});
airbrake.addFilter((notice) => {
console.log(notice);
return notice;
});
return {
requestError: (rejection) => {
console.log(rejection);
// do something on error
airbrake.notify(rejection);
return $q.reject(rejection);
},
responseError: (rejection) => {
console.log(rejection);
airbrake.notify(rejection);
return $q.reject(rejection);
}
};
};
Then in the config:
let httpAuthConfig = /*@ngInject*/ $httpProvider => {
'use strict';
let errorHttp = $injector => { return $injector.get('errorHttpInterceptor'); };
$httpProvider.interceptors.push(['$injector', errorHttp]);
};
It seem to work only that I get [object Object]
as the error on airbrake, no additional error detail or Backtrace. Is there something else I'm missing?