处理异常 koa官网 koa周边相关生态 处理异常// 在最外层添加异常捕获的中间件app.use(async(ctx,next) => { try{ await next() // 捕获异步异常 } catch(err){ ctx.status = 500 ctx.body = '服务端异常' // ctx.throw(err) }})