Log error json payloads in Sentry

This commit is contained in:
Brett Sun 2016-04-13 10:19:41 +02:00
parent 91cc3c63ff
commit d995dc238b
1 changed files with 7 additions and 0 deletions

View File

@ -15,6 +15,13 @@ import AppConstants from '../constants/application_constants';
function logGlobal(error, comment, ignoreSentry) {
console.error(error);
if (error.hasOwnProperty('json')) {
comment = {
...comment,
json: error.json
};
}
if (!ignoreSentry) {
Raven.captureException(error, comment ? { extra: { comment } } : undefined);
}