diff --git a/src/app/sagas/error.ts b/src/app/sagas/error.ts index 44655a752..9597e640e 100644 --- a/src/app/sagas/error.ts +++ b/src/app/sagas/error.ts @@ -1,10 +1,16 @@ import { takeLatest } from 'redux-saga/effects'; +import { SagaIterator } from 'redux-saga'; +import { captureException } from '@sentry/browser'; import { BaseAction, ErrorAction } from '../actions'; export function* handleErrorSaga({ payload: e -}: ErrorAction): IterableIterator { - console.error(e); +}: ErrorAction): SagaIterator { + if (process.env.SENTRY_ENABLE) { + captureException(e); + } else { + console.error(e); + } } export default function* errorRootSaga() {