@ditojs/server 1.15.0 → 1.16.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ditojs/server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Dito.js Server – Dito.js is a declarative and modern web framework, based on Objection.js, Koa.js and Vue.js",
|
|
6
6
|
"repository": "https://github.com/ditojs/dito/tree/master/packages/server",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"node >= 18"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@ditojs/admin": "^1.
|
|
28
|
+
"@ditojs/admin": "^1.16.0",
|
|
29
29
|
"@ditojs/build": "^1.14.0",
|
|
30
|
-
"@ditojs/router": "^1.
|
|
31
|
-
"@ditojs/utils": "^1.
|
|
30
|
+
"@ditojs/router": "^1.16.0",
|
|
31
|
+
"@ditojs/utils": "^1.16.0",
|
|
32
32
|
"@koa/cors": "^4.0.0",
|
|
33
33
|
"@koa/multer": "^3.0.2",
|
|
34
34
|
"@originjs/vite-plugin-commonjs": "^1.0.3",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"typescript": "^4.9.3"
|
|
95
95
|
},
|
|
96
96
|
"types": "types",
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "e7e7ddb88965dbffc29c0968054015a647844803"
|
|
98
98
|
}
|
package/src/app/Application.js
CHANGED
|
@@ -690,7 +690,7 @@ export class Application extends Koa {
|
|
|
690
690
|
|
|
691
691
|
formatError(error) {
|
|
692
692
|
// Shallow-clone the error to be able to delete hidden properties.
|
|
693
|
-
const copy = clone(error, { shallow: true })
|
|
693
|
+
const copy = clone(error, { shallow: true, enumerable: false })
|
|
694
694
|
// Remove headers added by the CORS middleware.
|
|
695
695
|
delete copy.headers
|
|
696
696
|
if (this.config.log.errors?.stack === false) {
|
|
@@ -20,7 +20,9 @@ export class ResponseError extends Error {
|
|
|
20
20
|
}
|
|
21
21
|
super(message, cause ? { cause } : {})
|
|
22
22
|
this.status = status
|
|
23
|
-
|
|
23
|
+
if (Object.keys(data).length > 0) {
|
|
24
|
+
this.data = data
|
|
25
|
+
}
|
|
24
26
|
// Allow `stack` overrides, e.g. for `RelationError`.
|
|
25
27
|
if (stack != null) {
|
|
26
28
|
this.stack = stack
|