1.0.4 • Published 5 years ago

@homitag/httpstatuserror v1.0.4

Weekly downloads
1
License
GPL-3.0
Repository
github
Last release
5 years ago

HTTPStatusError

This ES6 class built over Javascript Error class. This helps you add HTTP status codes, additional custom Error codes specific to your applications.

Usage

const HTTPStatusError = require('@homitag/httpstatuserror')

let errObj = new HTTPStatusError(HTTPStatusError.http_codes.BadRequest, 'Required username parameter is missing', new Error())

Note that the third is an optional parameter. You can use it for embeding your Javascript error object