Skip to content

Commit f568c4a

Browse files
committed
Moved Sentry noop function into block
- this function can be reduced in scope as it's only used in one of the branches
1 parent 36fb04f commit f568c4a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/shared/sentry.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ const config = require('./config');
22
const sentryConfig = config.get('sentry');
33
const errors = require('@tryghost/errors');
44

5-
const expressNoop = function (req, res, next) {
6-
next();
7-
};
8-
95
if (sentryConfig && !sentryConfig.disabled) {
106
const Sentry = require('@sentry/node');
117
const version = require('../server/lib/ghost-version').full;
@@ -34,6 +30,10 @@ if (sentryConfig && !sentryConfig.disabled) {
3430
captureException: Sentry.captureException
3531
};
3632
} else {
33+
const expressNoop = function (req, res, next) {
34+
next();
35+
};
36+
3737
module.exports = {
3838
requestHandler: expressNoop,
3939
errorHandler: expressNoop,

0 commit comments

Comments
 (0)