Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Latest commit

 

History

History
41 lines (27 loc) · 1.34 KB

README.md

File metadata and controls

41 lines (27 loc) · 1.34 KB

interference2

NPM version NPM downloads styled with prettier Dependencies Status

Custom error factory for microservices with HTTP code and internal type props Edit

Install

npm install interference

Usage

import Interference, { isInterference } from 'interference'

const err = Interference({ message: 'Good news everyone', type: 'FUTURAMA' })

if (isInterference(err) && err.type === 'FUTURAMA') {
  console.log('We have a special delivery today')
}

Factory Signature

({ message: string, type?: string, details?: any, code?: number }): Interference

Referenct to < es6 target

Extending built-ins Error