@azteam/express 1.2.486 → 1.2.488
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/lib/Server.js +1 -0
- package/package.json +1 -1
- package/src/Server.js +4 -0
package/lib/Server.js
CHANGED
|
@@ -341,6 +341,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
341
341
|
});
|
|
342
342
|
app.use(function (err, req, res, next) {
|
|
343
343
|
var error = (0, _error.errorCatch)(err);
|
|
344
|
+
error.url = req.originalUrl;
|
|
344
345
|
if (process.env.NODE_ENV === 'development') {
|
|
345
346
|
console.log(error.errors);
|
|
346
347
|
}
|
package/package.json
CHANGED
package/src/Server.js
CHANGED
|
@@ -314,6 +314,9 @@ class Server {
|
|
|
314
314
|
|
|
315
315
|
app.use((err, req, res, next) => {
|
|
316
316
|
const error = errorCatch(err);
|
|
317
|
+
|
|
318
|
+
error.url = req.originalUrl;
|
|
319
|
+
|
|
317
320
|
if (process.env.NODE_ENV === 'development') {
|
|
318
321
|
console.log(error.errors);
|
|
319
322
|
}
|
|
@@ -327,6 +330,7 @@ class Server {
|
|
|
327
330
|
if (error.errors[0].code === UNKNOWN) {
|
|
328
331
|
error.errors[0].message = '';
|
|
329
332
|
}
|
|
333
|
+
|
|
330
334
|
return res.status(error.status).json({success: false, errors: error.errors});
|
|
331
335
|
});
|
|
332
336
|
|