@lbu/server
Advanced tools
Comparing version 0.0.72 to 0.0.73
{ | ||
"name": "@lbu/server", | ||
"version": "0.0.72", | ||
"version": "0.0.73", | ||
"description": "Koa server and common middleware", | ||
@@ -19,4 +19,4 @@ "main": "./index.js", | ||
"dependencies": { | ||
"@lbu/insight": "0.0.72", | ||
"@lbu/stdlib": "0.0.72", | ||
"@lbu/insight": "0.0.73", | ||
"@lbu/stdlib": "0.0.73", | ||
"formidable": "2.0.0-canary.20200504.1", | ||
@@ -49,3 +49,3 @@ "keygrip": "1.1.0", | ||
}, | ||
"gitHead": "313aea34b9606e0dbebf81a60fc4a5d55bc61728" | ||
"gitHead": "22603779ea94b0737e458bd2c427486da58900c8" | ||
} |
@@ -45,22 +45,6 @@ import { AppError, isNil, isStaging } from "@lbu/stdlib"; | ||
let originalError = undefined; | ||
if (err.originalError) { | ||
originalError = { | ||
name: err.originalError.name, | ||
message: err.originalError.message, | ||
stack: err.originalError.stack.split("\n"), | ||
}; | ||
if (AppError.instanceOf(err.originalError)) { | ||
originalError.key = err.originalError.key; | ||
originalError.info = err.originalError.info; | ||
} | ||
} | ||
const formatted = AppError.format(error); | ||
log({ | ||
type: "API_ERROR", | ||
status: err.status, | ||
key: err.key, | ||
info: err.info, | ||
originalError, | ||
...formatted, | ||
}); | ||
@@ -70,3 +54,3 @@ | ||
ctx.body.info = ctx.body.info || {}; | ||
ctx.body.info._error = originalError; | ||
ctx.body.info._error = formatted; | ||
} | ||
@@ -73,0 +57,0 @@ } |
55960
1781
+ Added@lbu/insight@0.0.73(transitive)
+ Added@lbu/stdlib@0.0.73(transitive)
+ Added@types/node@14.11.1(transitive)
- Removed@lbu/insight@0.0.72(transitive)
- Removed@lbu/stdlib@0.0.72(transitive)
- Removed@types/node@14.10.2(transitive)
Updated@lbu/insight@0.0.73
Updated@lbu/stdlib@0.0.73