interference
v2.1.0
Published
Custom error factory for microservices with http code and "internal" code props
Downloads
55
Readme
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