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

@salsita/koa-error-middleware

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@salsita/koa-error-middleware

[![NPM version](https://img.shields.io/npm/v/@salsita/koa-error-middleware.svg)](https://www.npmjs.com/package/@salsita/koa-error-middleware) ![Downloads](https://img.shields.io/npm/dm/@salsita/koa-error-middleware.svg?style=flat) ![Licence](https://img.s

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

@salsita/koa-error-middleware

NPM version Downloads Licence Dependency Status devDependency Status

Top level middleware for catching and displaying errors (assumes using error classes from @salsita/errors).

Expects logging function as parameter.

Example:

const winston = require("winston");
const Router = require("koa-router");
const errorMiddleware = require("@salsita/koa-error-middleware");

const formatUserMessage = err =>
  process.env.NODE_ENV === "production" ? "Ooops something went wrong" : err.message;

const router = new Router();
router.use(errorMiddleware(winston.log, formatUserMessage));

FAQs

Package last updated on 26 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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