Comparing version 0.13.0 to 0.13.1
@@ -23,2 +23,7 @@ <h1 align="center">Fastify</h1> | ||
<a name="error-handling"></a> | ||
#### Error handling | ||
The error handling is done by [avvio](https://github.com/mcollina/avvio#error-handling). | ||
As general rule is highly recommended that you handle your errors in the `register`'s callback, otherwise the server will not start, and you will find the unhandled error in the `listen` callback. | ||
<a name="create-plugin"></a> | ||
@@ -25,0 +30,0 @@ ### Create a plugin |
@@ -150,3 +150,4 @@ 'use strict' | ||
function listen (port, cb) { | ||
fastify.ready(function () { | ||
fastify.ready(function (err) { | ||
if (err) return cb(err) | ||
server.listen(port, cb) | ||
@@ -153,0 +154,0 @@ }) |
{ | ||
"name": "fastify", | ||
"version": "0.13.0", | ||
"version": "0.13.1", | ||
"description": "Fast and low overhead web framework, for Node.js", | ||
@@ -62,3 +62,3 @@ "main": "fastify.js", | ||
"ajv": "^4.11.5", | ||
"avvio": "^0.5.0", | ||
"avvio": "^0.6.1", | ||
"body": "^5.1.0", | ||
@@ -65,0 +65,0 @@ "fast-json-stringify": "^0.10.4", |
@@ -22,2 +22,3 @@ <div align="center"> | ||
### Core features | ||
- **100% asynchronous:** all the core is implemented with asynchronous code, in this way not even a millisecond is wasted. | ||
@@ -24,0 +25,0 @@ - **Highly performant:** as far as we know, Fastify is one of the fastest web frameworks in town, depending on the code complexity we can serve up to 20000 request per second. |
@@ -286,1 +286,15 @@ 'use strict' | ||
}) | ||
test('if a plugin raises an error and there is not a callback to handle it, the server must not start', t => { | ||
t.plan(2) | ||
const fastify = Fastify() | ||
fastify.register((instance, opts, next) => { | ||
next(new Error('err')) | ||
}) | ||
fastify.listen(0, err => { | ||
t.ok(err instanceof Error) | ||
t.is(err.message, 'err') | ||
}) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
136271
3675
80
+ Addedavvio@0.6.1(transitive)
- Removedavvio@0.5.0(transitive)
Updatedavvio@^0.6.1