在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:koajs/onerror开源软件地址:https://github.com/koajs/onerror开源编程语言:JavaScript 94.1%开源软件介绍:koa-onerroran error handler for koa, hack ctx.onerror. different with koa-error:
installnpm install koa-onerror Usageconst fs = require('fs');
const koa = require('koa');
const onerror = require('koa-onerror');
const app = new koa();
onerror(app);
app.use(ctx => {
// foo();
ctx.body = fs.createReadStream('not exist');
}); Optionsonerror(app, options);
check out default handler to write your own handler. Status and Headers
LicenseContributors |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论