kb-server 0.0.7 → 0.0.9

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.
@@ -67,7 +67,15 @@ const packAPI = (apis, options) => {
67
67
  return res.send(response);
68
68
  }
69
69
  catch (rawError) {
70
- logger_1.logger.error({ requestId, action: Action, error: rawError }, "请求处理异常");
70
+ // 检查是否有堆栈信息,如果有则添加到日志中
71
+ const errorLog = {
72
+ requestId,
73
+ action: Action,
74
+ error: rawError,
75
+ // 添加堆栈信息
76
+ stack: rawError?.stack
77
+ };
78
+ logger_1.logger.error(errorLog, "请求处理异常");
71
79
  // 未知错误
72
80
  let error = new create_errors_1.CommonErrors.InternalError.UnknownError();
73
81
  // 可控错误
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kb-server",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "A fast server for Node.JS,made by express.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -33,8 +33,15 @@
33
33
  "utility-types": "^3.11.0",
34
34
  "uuid": "^11.0.3"
35
35
  },
36
- "devDependencies": {
37
- "@types/express": "^4.17.21",
36
+ "peerDependencies": {
38
37
  "pino-pretty": "^13.1.3"
38
+ },
39
+ "peerDependenciesMeta": {
40
+ "pino-pretty": {
41
+ "optional": true
42
+ }
43
+ },
44
+ "devDependencies": {
45
+ "@types/express": "^4.17.21"
39
46
  }
40
47
  }