qoq-json-error

0.0.8 • Public • Published

qoq-json-error

JSON error support for qoq based on koa-json-error

Installation

yarn add qoq-json-error

Usage

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'
    }
  }));

Options

@see koa-json-error

Readme

Keywords

none

Package Sidebar

Install

npm i qoq-json-error

Weekly Downloads

0

Version

0.0.8

License

MIT

Unpacked Size

3.99 kB

Total Files

8

Last publish

Collaborators

  • fwh1990