Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@compas/server

Package Overview
Dependencies
Maintainers
1
Versions
196
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@compas/server - npm Package Compare versions

Comparing version 0.10.6 to 0.11.0

4

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc