@steedos/service-api 2.7.0-beta.9 → 2.7.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/index.js +8 -2
- package/package.json +6 -6
package/index.js
CHANGED
|
@@ -305,10 +305,16 @@ module.exports = {
|
|
|
305
305
|
try {
|
|
306
306
|
res.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
307
307
|
res.writeHead(err.code || 500);
|
|
308
|
+
|
|
309
|
+
let msg = err.message;
|
|
310
|
+
|
|
311
|
+
if(err.code === 422 && err.type === 'VALIDATION_ERROR'){
|
|
312
|
+
msg = err.data.map(item => item.message).join('');
|
|
313
|
+
}
|
|
314
|
+
|
|
308
315
|
res.end(JSON.stringify({
|
|
309
316
|
"status": -1,
|
|
310
|
-
"msg":
|
|
311
|
-
"data": {}
|
|
317
|
+
"msg": msg
|
|
312
318
|
}));
|
|
313
319
|
} catch (Exception) {
|
|
314
320
|
res.writeHead(500);
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-api",
|
|
3
|
-
"version": "2.7.0
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@steedos/auth": "2.7.0
|
|
8
|
-
"@steedos/router": "2.7.0
|
|
9
|
-
"@steedos/service-object-graphql": "2.7.0
|
|
10
|
-
"@steedos/service-ui": "2.7.0
|
|
7
|
+
"@steedos/auth": "2.7.0",
|
|
8
|
+
"@steedos/router": "2.7.0",
|
|
9
|
+
"@steedos/service-object-graphql": "2.7.0",
|
|
10
|
+
"@steedos/service-ui": "2.7.0",
|
|
11
11
|
"graphql": "^15.8.0",
|
|
12
12
|
"graphql-iso-date": "^3.6.1",
|
|
13
13
|
"graphql-type-json": "^0.3.2",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "2f1586ea4f8af5b93753878e96f1f48adbef31a7",
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/graphql-iso-date": "^3.4.0",
|
|
28
28
|
"@types/react-dev-utils": "^9.0.11"
|