mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05: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
1 changed files with 4 additions and 4 deletions
|
@ -2,10 +2,6 @@ const config = require('./config');
|
||||||
const sentryConfig = config.get('sentry');
|
const sentryConfig = config.get('sentry');
|
||||||
const errors = require('@tryghost/errors');
|
const errors = require('@tryghost/errors');
|
||||||
|
|
||||||
const expressNoop = function (req, res, next) {
|
|
||||||
next();
|
|
||||||
};
|
|
||||||
|
|
||||||
if (sentryConfig && !sentryConfig.disabled) {
|
if (sentryConfig && !sentryConfig.disabled) {
|
||||||
const Sentry = require('@sentry/node');
|
const Sentry = require('@sentry/node');
|
||||||
const version = require('../server/lib/ghost-version').full;
|
const version = require('../server/lib/ghost-version').full;
|
||||||
|
@ -34,6 +30,10 @@ if (sentryConfig && !sentryConfig.disabled) {
|
||||||
captureException: Sentry.captureException
|
captureException: Sentry.captureException
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
const expressNoop = function (req, res, next) {
|
||||||
|
next();
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
requestHandler: expressNoop,
|
requestHandler: expressNoop,
|
||||||
errorHandler: expressNoop,
|
errorHandler: expressNoop,
|
||||||
|
|
Loading…
Add table
Reference in a new issue