Fix slight bug in context error handler

This commit is contained in:
Jonatan Nilsson 2021-01-04 17:33:15 +00:00
parent d1bcd10f82
commit dc572cd83a
2 changed files with 2 additions and 2 deletions

View file

@ -106,7 +106,7 @@ const proto = module.exports = {
// don't do anything if there is no error. // don't do anything if there is no error.
// this allows you to pass `this.onerror` // this allows you to pass `this.onerror`
// to node-style callbacks. // to node-style callbacks.
if (null == err) return; if (!err) return;
if (!(err instanceof Error)) err = new Error(util.format('non-error thrown: %j', err)); if (!(err instanceof Error)) err = new Error(util.format('non-error thrown: %j', err));

View file

@ -1,6 +1,6 @@
{ {
"name": "koa-lite", "name": "koa-lite",
"version": "2.10.0", "version": "2.10.1",
"description": "Lite version of the Koa web app framework", "description": "Lite version of the Koa web app framework",
"main": "lib/application.js", "main": "lib/application.js",
"scripts": { "scripts": {