0.0.2 • Published 9 years ago

express-async-error v0.0.2

Weekly downloads
306
License
-
Repository
github
Last release
9 years ago

express-async-error

Expressjs handles error on try/catch basis, which is very helpful, but doesn't take care of asynchronous errors (errors in callbacks). This middleware handles those with usage of domains.

npm install express-async-error

Installation

All you need to do is add handler like this:

var express = require('express');
var errorHandler = require('express-async-error').Handler

var app = new express()

app.use(errorHandler([options]))

...

app.listen(...)

Arguments

  • options:
    • domainPropertyName: name of property to assign created domain (default: _domain)

See tests for complete usage example.

TODO

  • subdomain support