mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-22 19:01:10 -04:00
Add Sentry to client for error handling (#43920)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
@@ -4,14 +4,14 @@ import { isHandledError } from '../utils/create-handled-error';
|
||||
|
||||
// sends directly to Sentry
|
||||
export function reportError(err) {
|
||||
return sentry.dns === 'dsn_from_sentry_dashboard'
|
||||
return sentry.dsn === 'dsn_from_sentry_dashboard'
|
||||
? console.error(err)
|
||||
: captureException(err);
|
||||
}
|
||||
|
||||
// determines which errors should be reported
|
||||
export default function sentryErrorHandler() {
|
||||
return sentry.dns === 'dsn_from_sentry_dashboard'
|
||||
return sentry.dsn === 'dsn_from_sentry_dashboard'
|
||||
? (req, res, next) => next()
|
||||
: Handlers.errorHandler({
|
||||
shouldHandleError(err) {
|
||||
|
||||
Reference in New Issue
Block a user