Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return (err, ...data) => {
if (err) {
// check if the stacktrace has no context, if so, if so append the frames we created earlier
if (err.stack) maybeUseFallbackStack(err, fallbackStack)
const report = createReportFromErr(err, {
severity: 'warning',
unhandled: false,
severityReason: { type: 'callbackErrorIntercept' }
})
client.notify(report, opts)
return
}
cb(...data) // eslint-disable-line
}
}
dom.on('error', err => {
// check if the stacktrace has no context, if so, if so append the frames we created earlier
if (err.stack) maybeUseFallbackStack(err, fallbackStack)
const report = createReportFromErr(err, {
severity: 'error',
unhandled: true,
severityReason: { type: 'unhandledException' }
})
client.notify(report, opts, (e, report) => {
if (e) client._logger.error('Failed to send report to Bugsnag')
client.config.onUncaughtException(err, report, client._logger)
})
})
process.nextTick(() => dom.run(fn))