description |
---|
Use this middleware to safely catch and serialize unexpected errors. |
const express = require('express');
const { middleware, errorMiddleware } = require('envoy-integrations-sdk-nodejs');
const app = express();
app.use(middleware());
// define endpoints here
app.use(errorMiddleware());
Returns an Express.js error middleware, which serializes unexpected errors.
Kind: global function
Express/connect middleware.
Kind: global typedef
Param | Type |
---|---|
err | Error |
req | http://expressjs.com/en/4x/api.html#req |
res | http://expressjs.com/en/4x/api.html#res |
next | function |