How to use the errorHandler function from raven
Find comprehensive JavaScript raven.errorHandler code examples handpicked from public code repositorys.
45 46 47 48 49 50 51 52 53 54
* Returns a Sentry error handler in case * Sentry client is set up. */ exports.errorHandler = () => { if (SENTRY_DSN) { return Raven.errorHandler(); } else { return (err, req, res, next) => { next(err); };
958
0
4
11 12 13 14 15 16 17 18 19 20
function errorHandler(options) { options = defaultOptions(options); // Handler for sending errors to Sentry const ravenErrorHandler = raven.errorHandler(); // Handler for rendering to the user function standardErrorHandler(error, request, response) { const ft = request.app.ft;
2
2
32
GitHub: Financial-Times/n-raven
71 72 73 74 75 76 77 78 79 80
// Support for the legacy captureError function. raven.captureError = raven.captureException.bind(raven); module.exports = raven; const _errorHandler = raven.errorHandler.bind(raven); module.exports.errorHandler = function () { const middleware = _errorHandler(); return (err, req, res, next) => { if (!res.locals.suppressRavenLogger) {
2
1
89
+ 3 other calls in file
30 31 32 33 34 35 36 37 38 39
if (!Raven.installed) { return next(err) } return Raven.errorHandler()(err, req, res, next) } } module.exports = {
0
0
2
raven.captureException is the most popular function in raven (228 examples)