@napp/dti-server 4.1.5 → 4.2.2
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 +3 -2
- package/server.js +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@napp/dti-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.2",
|
|
4
4
|
"description": "data transaction interface server library",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"author": "Farcek <farcek@gmail.com>",
|
|
17
17
|
"license": "ISC",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@napp/dti-core": "4.
|
|
19
|
+
"@napp/dti-core": "4.2.2",
|
|
20
|
+
"@napp/exception": "^4.1.2",
|
|
20
21
|
"base64url": "latest"
|
|
21
22
|
}
|
|
22
23
|
}
|
package/server.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DtiServer = void 0;
|
|
4
|
-
const dti_core_1 = require("@napp/dti-core");
|
|
5
4
|
const route_1 = require("./route");
|
|
6
5
|
const bundler_1 = require("./bundler");
|
|
6
|
+
const exception_1 = require("@napp/exception");
|
|
7
7
|
class DtiServer {
|
|
8
8
|
constructor(root) {
|
|
9
9
|
this.root = root;
|
|
@@ -42,7 +42,9 @@ class DtiServer {
|
|
|
42
42
|
new bundler_1.BundlerServer(server).setup(route, setuper);
|
|
43
43
|
route.use(server.root.getLocalPath(), new route_1.DtiServerRoute(server.root, server).setup(setuper));
|
|
44
44
|
route.use((err, req, res, next) => {
|
|
45
|
-
|
|
45
|
+
let error = exception_1.Exception.from(err);
|
|
46
|
+
let status = error.status || 500;
|
|
47
|
+
res.status(status).json(error.toPlan());
|
|
46
48
|
});
|
|
47
49
|
return route;
|
|
48
50
|
}
|