JSON error support for qoq based on koa-json-error
yarn add qoq-json-error
import { WebSlotManager } from 'qoq';
import { JsonError } from 'qoq-json-error';
export webSlots = WebSlotManager
.use(new JsonError((err) => {
return {
// Copy some attributes from
// the original error
status: err.status,
message: err.message,
// ...or add some custom ones
success: false,
reason: 'Unexpected'
}
}));
@see koa-json-error