@vtj/local 0.7.12 → 0.7.14

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.
@@ -76,7 +76,11 @@ export const router = async (req) => {
76
76
  try {
77
77
  return await handler(body);
78
78
  } catch (e) {
79
- await service.saveLogs(e);
79
+ const info = {
80
+ input: body,
81
+ error: e
82
+ };
83
+ await service.saveLogs(info);
80
84
  return fail("\u5F02\u5E38\u9519\u8BEF", e);
81
85
  }
82
86
  };
package/dist/service.mjs CHANGED
@@ -10,7 +10,7 @@ export async function notMatch(_req) {
10
10
  return fail("\u627E\u4E0D\u5230\u5904\u7406\u7A0B\u5E8F");
11
11
  }
12
12
  export async function saveLogs(e) {
13
- const name = `error-${timestamp()}.json`;
13
+ const name = `error-${timestamp()}`;
14
14
  const logs = new JsonRepository("logs");
15
15
  const json = JSON.parse(JSON.stringify(e));
16
16
  return logs.save(name, json);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vtj/local",
3
3
  "private": false,
4
- "version": "0.7.12",
4
+ "version": "0.7.14",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "unbuild",
@@ -10,12 +10,12 @@
10
10
  "coverage": "vitest run --coverage"
11
11
  },
12
12
  "dependencies": {
13
- "@vtj/coder": "^0.7.12",
14
- "@vtj/core": "^0.7.12",
13
+ "@vtj/coder": "^0.7.14",
14
+ "@vtj/core": "^0.7.14",
15
15
  "@vtj/node": "^0.7.5"
16
16
  },
17
17
  "devDependencies": {
18
- "@vtj/cli": "^0.7.9",
18
+ "@vtj/cli": "^0.7.10",
19
19
  "unbuild": "~2.0.0",
20
20
  "vite": "~5.0.12",
21
21
  "vitest": "~1.2.1"
@@ -34,7 +34,7 @@
34
34
  "files": [
35
35
  "dist"
36
36
  ],
37
- "gitHead": "e893df5593e0df19de9fdc35c486faef1a31f273",
37
+ "gitHead": "8e69e3eea31f488f318f28013b7ef3df02ee8174",
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  }