@azteam/express 1.2.195 → 1.2.196

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Server.js +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azteam/express",
3
- "version": "1.2.195",
3
+ "version": "1.2.196",
4
4
  "main": "src/index.js",
5
5
  "engines": {
6
6
  "node": ">= 12.0.0",
package/src/Server.js CHANGED
@@ -10,7 +10,7 @@ import morgan from 'morgan';
10
10
  import cors from 'cors';
11
11
  import _ from 'lodash';
12
12
  import 'express-async-errors';
13
- import {CORS, errorCatch, ErrorException, NOT_FOUND, UNKNOWN} from '@azteam/error';
13
+ import {errorCatch, CORS, ErrorException, NOT_FOUND, UNKNOWN} from '@azteam/error';
14
14
 
15
15
  const RES_TYPE = {
16
16
  ARRAY: 'ARRAY',
@@ -310,7 +310,9 @@ class Server {
310
310
  app.use((err, req, res, next) => {
311
311
  const error = errorCatch(err);
312
312
 
313
- if (error.errors[0].code === UNKNOWN) {
313
+ if (process.env.NODE_ENV === 'development') {
314
+ console.log(error.errors);
315
+ } else if (error.errors[0].code === UNKNOWN) {
314
316
  console.error(req.originalUrl, err);
315
317
  }
316
318