UNPKG

@femto-apps/errors

Version:

A simple JavaScript library to handle errors in APIs

11 lines (7 loc) 253 B
const Errors = require('../')('errors.json') function test() { const error = Errors('ERR_CONSUMER_SAVE', { file: 'test.txt' }) console.log(error instanceof Error) throw Errors('ERR_CONSUMER_SAVE', { file: 'test.txt' }) } test()