This package has been deprecated

Author message:

Deprecated. Use @malijs/onerror

mali-onerror
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

mali-onerror

Mali on error middleware. Calls function with error and context. The called function does not have access to control flow.

npm version build status Greenkeeper badge

API

mali-onerror ⇒ function

Mali on error middleware. Calls function with error and context. The called function does not have access to control flow.

Returns: function - the middleware function

Param Type Description
fn function The function to call when an error occurs. Function has to have signature with signature (err, ctx)

Example

const onError = require('mali-onerror')
 
function errorLogger (err, ctx) {
  console.log('Error on %s: %s', ctx.name, err.toString())
}
 
app.use(onError(errorLogger))

License

Apache-2.0

Package Sidebar

Install

npm i mali-onerror

Weekly Downloads

1

Version

0.2.0

License

Apache-2.0

Unpacked Size

15.7 kB

Total Files

6

Last publish

Collaborators

  • bojand