@tryghost/mw-error-handler 0.1.1 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/lib/mw-error-handler.js +7 -7
- package/package.json +7 -5
package/LICENSE
CHANGED
package/README.md
CHANGED
package/lib/mw-error-handler.js
CHANGED
|
@@ -173,27 +173,27 @@ module.exports.pageNotFound = (req, res, next) => {
|
|
|
173
173
|
};
|
|
174
174
|
|
|
175
175
|
module.exports.handleJSONResponse = sentry => [
|
|
176
|
-
// Make sure the error can be served
|
|
177
|
-
module.exports.prepareError,
|
|
178
176
|
// Handle the error in Sentry
|
|
179
177
|
sentry.errorHandler,
|
|
178
|
+
// Make sure the error can be served
|
|
179
|
+
module.exports.prepareError,
|
|
180
180
|
// Render the error using JSON format
|
|
181
181
|
jsonErrorRenderer
|
|
182
182
|
];
|
|
183
183
|
|
|
184
184
|
module.exports.handleJSONResponseV2 = sentry => [
|
|
185
|
-
// Make sure the error can be served
|
|
186
|
-
module.exports.prepareError,
|
|
187
185
|
// Handle the error in Sentry
|
|
188
186
|
sentry.errorHandler,
|
|
187
|
+
// Make sure the error can be served
|
|
188
|
+
module.exports.prepareError,
|
|
189
189
|
// Render the error using JSON format
|
|
190
190
|
jsonErrorRendererV2
|
|
191
191
|
];
|
|
192
192
|
|
|
193
193
|
module.exports.handleHTMLResponse = sentry => [
|
|
194
|
-
// Make sure the error can be served
|
|
195
|
-
module.exports.prepareError,
|
|
196
194
|
// Handle the error in Sentry
|
|
197
|
-
sentry.errorHandler
|
|
195
|
+
sentry.errorHandler,
|
|
196
|
+
// Make sure the error can be served
|
|
197
|
+
module.exports.prepareError
|
|
198
198
|
];
|
|
199
199
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/mw-error-handler",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"repository": "https://github.com/TryGhost/Utils/tree/main/packages/mw-error-handler",
|
|
5
5
|
"author": "Ghost Foundation",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"dev": "echo \"Implement me!\"",
|
|
10
|
-
"test": "NODE_ENV=testing c8 --check-coverage mocha './test/**/*.test.js'",
|
|
10
|
+
"test": "NODE_ENV=testing c8 --all --check-coverage --reporter text --reporter cobertura mocha './test/**/*.test.js'",
|
|
11
11
|
"lint": "eslint . --ext .js --cache",
|
|
12
12
|
"posttest": "yarn lint"
|
|
13
13
|
},
|
|
@@ -19,14 +19,16 @@
|
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"c8": "7.
|
|
22
|
+
"c8": "7.11.0",
|
|
23
23
|
"mocha": "9.1.3",
|
|
24
24
|
"should": "13.2.3",
|
|
25
25
|
"sinon": "12.0.1"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@tryghost/debug": "^0.1.9",
|
|
29
|
-
"@tryghost/
|
|
29
|
+
"@tryghost/errors": "1.2.5",
|
|
30
|
+
"@tryghost/tpl": "^0.1.8",
|
|
31
|
+
"lodash": "4.17.21"
|
|
30
32
|
},
|
|
31
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "3bf8b2007541db078debd4d6b4b9f16e66f08c60"
|
|
32
34
|
}
|