iso-error-web
TypeScript icon, indicating that this package has built-in type declarations

2.4.1 • Public • Published

iso-error-web

NPM version NPM downloads Codecov

iso-error web extension.

This library contains common errors and utility for web application.

Install

yarn add iso-error-web

Usage

import { createHttpError, HttpStatus } from 'iso-error-web'

const error = createHttpError(HttpStatus.BadRequest, 'message', optionalIsoErrorOption)

It also provides a plugin for serialization:

import { IsoError } from 'iso-error'
import { webPlugin } from 'iso-error-web'

IsoError.addPlugin(webPlugin)

try {
  doSomeWorkThatThrows()
} catch (e) {
  response.emit(IsoError.serialize(e))
}

Readme

Keywords

none

Package Sidebar

Install

npm i iso-error-web

Weekly Downloads

1

Version

2.4.1

License

MIT

Unpacked Size

164 kB

Total Files

14

Last publish

Collaborators

  • unional