mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-27 19:42:11 +10:00
Always add error info to Sentry logging
This commit is contained in:
parent
def1b3d6a7
commit
0ed1d879a5
3 changed files with 5 additions and 11 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { pick } from 'lodash';
|
||||
import { denormalisedResponseEntities } from '../../util/data';
|
||||
import { storableError, responseApiErrorInfo } from '../../util/errors';
|
||||
import { storableError } from '../../util/errors';
|
||||
import { TRANSITION_REQUEST } from '../../util/types';
|
||||
import * as log from '../../util/log';
|
||||
import { fetchCurrentUserHasOrdersSuccess } from '../../ducks/user.duck';
|
||||
|
|
@ -138,7 +138,6 @@ export const initiateOrder = (orderParams, initialMessage) => (dispatch, getStat
|
|||
listingId: orderParams.listingId.uuid,
|
||||
bookingStart: orderParams.bookingStart,
|
||||
bookingEnd: orderParams.bookingEnd,
|
||||
apiErrorInfo: responseApiErrorInfo(e),
|
||||
});
|
||||
throw e;
|
||||
});
|
||||
|
|
@ -185,7 +184,6 @@ export const speculateTransaction = params => (dispatch, getState, sdk) => {
|
|||
listingId: listingId.uuid,
|
||||
bookingStart,
|
||||
bookingEnd,
|
||||
apiErrorInfo: responseApiErrorInfo(e),
|
||||
});
|
||||
return dispatch(speculateTransactionError(storableError(e)));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,10 +1,6 @@
|
|||
import { pick } from 'lodash';
|
||||
import { types as sdkTypes } from '../../util/sdkLoader';
|
||||
import {
|
||||
isTransactionsTransitionInvalidTransition,
|
||||
storableError,
|
||||
responseApiErrorInfo,
|
||||
} from '../../util/errors';
|
||||
import { isTransactionsTransitionInvalidTransition, storableError } from '../../util/errors';
|
||||
import {
|
||||
TRANSITION_ACCEPT,
|
||||
TRANSITION_DECLINE,
|
||||
|
|
@ -275,7 +271,6 @@ export const acceptSale = id => (dispatch, getState, sdk) => {
|
|||
log.error(e, 'accept-sale-failed', {
|
||||
txId: id,
|
||||
transition: TRANSITION_ACCEPT,
|
||||
apiErrorInfo: responseApiErrorInfo(e),
|
||||
});
|
||||
throw e;
|
||||
});
|
||||
|
|
@ -300,7 +295,6 @@ export const declineSale = id => (dispatch, getState, sdk) => {
|
|||
log.error(e, 'reject-sale-failed', {
|
||||
txId: id,
|
||||
transition: TRANSITION_DECLINE,
|
||||
apiErrorInfo: responseApiErrorInfo(e),
|
||||
});
|
||||
throw e;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
import Raven from 'raven-js';
|
||||
import config from '../config';
|
||||
import { responseApiErrorInfo } from './errors';
|
||||
|
||||
/**
|
||||
* Set up error handling. If a Sentry DSN is
|
||||
|
|
@ -53,7 +54,8 @@ export const clearUserId = () => {
|
|||
*/
|
||||
export const error = (e, code, data) => {
|
||||
if (Raven.isSetup()) {
|
||||
Raven.captureException(e, { tags: { code }, extra: data });
|
||||
const extra = { ...data, apiErrorData: responseApiErrorInfo(e) };
|
||||
Raven.captureException(e, { tags: { code }, extra });
|
||||
} else {
|
||||
console.error(e); // eslint-disable-line
|
||||
console.error('Error code:', code, 'data:', data);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue