npm install koa-onerror Usage constfs=require('fs');constKoa=require('koa');const{onerror}=require('koa-onerror');constapp=newKoa();onerror(app);app.use(ctx=>{// foo();ctx.body=fs.createReadStream('not exist');}); Options ...
我如果用koa脚手架搭的项目,里面已经有koa-onerror 了,是不是就不用catchError 了?小飞猪 2020-02-02 12:20:32 源自:4-3 异步异常处理方案 261 分享 收起 1回答 7七月 2020-02-06 22:36:13 oneerror不是太好用,你可以试试,我当时看了。 0 回复 相似问题koa 一直404 notfound 855 0 1 koa-...
每当我本地打开 safiri 的时候,本地的 koa 项目就会崩溃,不知道是啥情况。。 Listening on:8000 /Users/lmn/project/u-pain-i-guess/node_modules/koa/lib/application.js:133 const onerror = err => ctx.onerror(err); ^ TypeError: ctx.onerror is not afunctionat Array.onerror (/Users/lmn/proje...
Koa 莫名其妙报 ctx.onerror is not a function 是啥情况?bodyParser用法错误app .use...
Koa: 2.5.1 const onerror = err => ctx.onerror(err); ^ TypeError: ctx.onerror is not a function at Array.onerror (./server/node_modules/koa/lib/application.js:147:32) at listener (./server/node_modules/on-finished/index.js:169:15) at onFinish (./server/node_modules/on-finished...
koa-onerror an error handler for koa, hack ctx.onerror. different withkoa-error: we can not just use try catch to handle all errors, steams' and events' errors are directly handle byctx.onerror, so if we want to handle all errors in one place, the only way i can see is to hack...
router.routes()).use(router.allowedMethods()).on('error',console.error)app.onerror=console.error...