mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 18:52:14 +03:00
Moved Sentry noop function into block
- this function can be reduced in scope as it's only used in one of the branches
This commit is contained in:
parent
36fb04f735
commit
f568c4a65e
@ -2,10 +2,6 @@ const config = require('./config');
|
||||
const sentryConfig = config.get('sentry');
|
||||
const errors = require('@tryghost/errors');
|
||||
|
||||
const expressNoop = function (req, res, next) {
|
||||
next();
|
||||
};
|
||||
|
||||
if (sentryConfig && !sentryConfig.disabled) {
|
||||
const Sentry = require('@sentry/node');
|
||||
const version = require('../server/lib/ghost-version').full;
|
||||
@ -34,6 +30,10 @@ if (sentryConfig && !sentryConfig.disabled) {
|
||||
captureException: Sentry.captureException
|
||||
};
|
||||
} else {
|
||||
const expressNoop = function (req, res, next) {
|
||||
next();
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
requestHandler: expressNoop,
|
||||
errorHandler: expressNoop,
|
||||
|
Loading…
Reference in New Issue
Block a user