JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3718
  • Score
    100M100P100Q125870F
  • License MIT

Custom errors

Package Exports

  • @blackglory/errors

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@blackglory/errors) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

errors

Common errors.

Install

npm install --save @blackglory/errors
# or
yarn add @blackglory/errors

API

Interfaces

type CustomErrorConstructor<T extends CustomError = CustomError> = new (message?: string) => T

interface SerializableError {
  name: string
  message: string
  stack: string | null
}

CustomError

class CustomError extends Error {}

normalize

function normalize(err: Error): SerializableError