Skip to content

Commit

Permalink
Remedy error metadata not being passed correctly to bugsnag
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Muniz committed Jun 21, 2018
1 parent ce7c04c commit 1d306b9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/sagas/scheduleSaga.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function* updateSchedule() {
}
} catch (error) {
yield put({ type: 'GET_SCHEDULE_FAILURE', error })
logger.trackException(error, false)
logger.trackException(error)
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions app/sagas/userSaga.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function* doLogin(action) {
yield call(queryUserData)
}
} catch (error) {
logger.trackException(error, false)
logger.trackException(error)
yield put({ type: 'LOG_IN_FAILURE', error })
}
}
Expand All @@ -100,7 +100,8 @@ function* doTokenRefresh() {
if (secondError.message === invalidCredsMessage) {
// We tried again and got the same error
yield put({ type: 'PANIC_LOG_OUT' })
logger.trackException('InvalidCreds Error', false)
const invalidCredsError = new Error('InvalidCreds Error')
logger.trackException(invalidCredsError)
yield call(clearUserData)
}
}
Expand Down
5 changes: 4 additions & 1 deletion app/util/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ module.exports = {
report.severity = severity

if (metadata) {
report.metadata = metadata
report.metadata = {
...report.metadata,
loggerData: { ...metadata }
}
}
})
// tracker.trackEvent('Error', error)
Expand Down

0 comments on commit 1d306b9

Please sign in to comment.