Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
actionTransformer = identity,
stateTransformer = identity,
logger = console.error.bind(console, '[redux-raven-middleware] Reporting error to Sentry:')
} = options;
try {
Raven.captureBreadcrumb({
category: 'redux',
message: action.type
});
return next(action);
} catch (err) {
logger(err);
// Send the report.
Raven.captureException(err, {
extra: {
action: actionTransformer(action),
state: stateTransformer(store.getState()),
}
});
}
}
}
action.type === ADD_NOTIFICATION &&
action.payload.kind === 'unexpected-error'
) {
const {
meta: { error },
} = action;
// Check that the `error` is set
if (!error && process.env.NODE_ENV !== 'production')
// eslint-disable-next-line no-console
console.error('Missing error object when dispatching unexpected error.');
if (process.env.NODE_ENV !== 'production') return next(action);
// Send the error to Sentry
Raven.captureException(error);
// Generate a unique ID referring to the last generated Sentry error
const errorId = Raven.lastEventId();
// The error stack should be available in Sentry, so there is no
// need to print it in the console as well.
// We just notify that an error occured and provide the error ID.
// eslint-disable-next-line no-console
console.error(`An error occured (ID: ${errorId}).`);
// Inject the generated errorId into the notification values,
// in order to display it in the notification message.
return next({
...action,
payload: {
...action.payload,
values: {
if (!message.startsWith("Assert failed) ")) {
errorStr += `An error has occurred: `;
}
if (!stack.Contains(message)) {
errorStr += message;
}
errorStr += (errorStr.length ? "\n" : "") + stack;
LogError(errorStr);
if (recordWithSentry) {
/*(()=> {
// errors that should be shown to user, but not recorded
if (message.startsWith("KaTeX parse error: ")) return;
Raven.captureException(error);
})();*/
Raven.captureException(error, {extra: extraInfo});
}
// wait a bit, in case we're in a reducer function (calling dispatch from within a reducer errors)
setTimeout(()=> {
store.dispatch(new ACTNotificationMessageAdd(new NotificationMessage(errorStr)));
});
}
function reportException(ex) {
alertFail("Sorry your browser doesn't support this feature", "Can't Copy");
// take Mulder's advice - trustno1
if (Raven && Raven.isSetup()) {
if (Raven.captureException) {
Raven.captureException(ex);
}
}
}
if(debugScrollUtils) {
console.log("scrollUtils::scrollToElement(): POST_RETRY Final viewPort offset: ", getElementViewportOffset(el, scrollableElement), ", difference to target offset: ", getElementViewportOffset(el, scrollableElement) - desiredViewportOffset, " target scrollTop was ", scrollTarget, "final scrollTop is ", scrollableElement.scrollTop());
}
}
if (_.isFunction(callback)) {
callback();
}
if(watch) {
_watchOffset(el, scrollableElement);
}
}
catch (e) {
if (sentry_dsn) {
Raven.captureException(e);
} else {
throw e;
}
}
}
window.onunhandledrejection = (err) => {
Raven.captureException(err.reason);
};
const captureError = (error, errorType) => {
Raven.captureException(error, {
fingerprint: [formConfig.trackingPrefix, error.message],
extra: {
errorType,
statusText: error.statusText
}
});
recordEvent({
event: `${formConfig.trackingPrefix}-submission-failed${errorType.startsWith('client') ? '-client' : ''}`,
});
};
componentDidMount() {
const { error, details } = this.props;
Raven.captureException(error, details);
}
notifier.notify({
title: newMatch.person.name,
body: message.message
})
}
})
this.matches.set(newMatch._id, newMatch)
if (!silent) {
notifier.notify({
title: newMatch.person.name,
body: 'You have a new match!'
})
}
} catch (err) {
Raven.captureException(err)
}
} else {
oldMatch.update(match)
}
})
const reportOrLog = (error, info) => {
if (process.env.NODE_ENV === 'production') {
Raven.captureException(error);
}
if (info) {
if (process.env.NODE_ENV === 'production') {
Raven.captureMessage(info);
}
}
};