@compas/server
Advanced tools
Comparing version 0.10.6 to 0.11.0
{ | ||
"name": "@compas/server", | ||
"version": "0.10.6", | ||
"version": "0.11.0", | ||
"description": "Koa server and common middleware", | ||
@@ -24,3 +24,3 @@ "exports": { | ||
"dependencies": { | ||
"@compas/stdlib": "0.10.6", | ||
"@compas/stdlib": "0.11.0", | ||
"@types/formidable": "2.0.6", | ||
@@ -27,0 +27,0 @@ "@types/koa": "2.15.0", |
@@ -41,20 +41,13 @@ import { _compasSentryExport, AppError, isProduction } from "@compas/stdlib"; | ||
if (err.status >= 500) { | ||
if (_compasSentryExport) { | ||
if (err === origErr) { | ||
// An AppError.serverError was thrown. | ||
_compasSentryExport.captureException( | ||
new Error(err.key, { | ||
cause: err, | ||
}), | ||
); | ||
} else { | ||
// Something else was thrown. | ||
_compasSentryExport.captureException(origErr); | ||
} | ||
} | ||
const isUnexpectedError = err.status >= 500; | ||
if (isUnexpectedError) { | ||
// Upgrade to error logging, developer probably has alerting on error logs. | ||
log = ctx.log.error; | ||
} | ||
if (_compasSentryExport && isUnexpectedError) { | ||
_compasSentryExport.captureException(origErr); | ||
} | ||
ctx.status = err.status; | ||
@@ -70,4 +63,10 @@ | ||
if (isProduction()) { | ||
// Delete generic internals | ||
delete formatted.stack; | ||
delete formatted.cause; | ||
if (isUnexpectedError) { | ||
// Remove any possible internal details. In explicit 400's for example, info is useful to the caller. | ||
delete formatted.info; | ||
} | ||
} | ||
@@ -74,0 +73,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39995
1135
+ Added@compas/stdlib@0.11.0(transitive)
- Removed@compas/stdlib@0.10.6(transitive)
Updated@compas/stdlib@0.11.0