egg 3.17.4 → 3.17.6

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/README.md CHANGED
@@ -28,7 +28,7 @@ Follow the commands listed below.
28
28
 
29
29
  ```bash
30
30
  $ mkdir showcase && cd showcase
31
- $ npm init egg --type=simple
31
+ $ npm init egg --type=simple # Optionally pnpm create egg --type=simple
32
32
  $ npm install
33
33
  $ npm run dev
34
34
  $ open http://localhost:7001
@@ -236,8 +236,15 @@ module.exports = appInfo => {
236
236
  depth: 5,
237
237
  parameterLimit: 1000,
238
238
  },
239
- onerror(err) {
239
+ onerror(err, ctx) {
240
240
  err.message += ', check bodyParser config';
241
+ if (ctx.status === 404) {
242
+ // set default status to 400, meaning client bad request
243
+ ctx.status = 400;
244
+ if (!err.status) {
245
+ err.status = 400;
246
+ }
247
+ }
241
248
  throw err;
242
249
  },
243
250
  };
package/index.d.ts CHANGED
@@ -449,7 +449,7 @@ declare module 'egg' {
449
449
  /**
450
450
  * i18n resource file dir, not recommend to change default value
451
451
  */
452
- dir: string;
452
+ dirs: string[];
453
453
  /**
454
454
  * custom the locale value field, default `query.locale`, you can modify this config, such as `query.lang`
455
455
  */
@@ -34,7 +34,7 @@ class Singleton {
34
34
  return;
35
35
  }
36
36
 
37
- // multi clent, use app[name].getInstance(id)
37
+ // multi client, use app[name].getInstance(id)
38
38
  if (options.clients) {
39
39
  Object.keys(options.clients).forEach(id => {
40
40
  const client = this.createInstance(options.clients[id], id);
@@ -61,7 +61,7 @@ class Singleton {
61
61
  return;
62
62
  }
63
63
 
64
- // multi clent, use app[name].getInstance(id)
64
+ // multi client, use app[name].getInstance(id)
65
65
  if (options.clients) {
66
66
  await Promise.all(Object.keys(options.clients).map(id => {
67
67
  return this.createInstanceAsync(options.clients[id], id)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egg",
3
- "version": "3.17.4",
3
+ "version": "3.17.6",
4
4
  "publishConfig": {
5
5
  "tag": "latest"
6
6
  },