http-smart-error
Subclass of SmartError for handling http errors.
Installation
npm install http-smart-error --save
Usage
; console; // Http error with 400 status code, message "Bad request" and code "ERR_BAD_REQUEST" console; // Http error with 403 status code, message "User has no permissions to do that.", code "ERR_NO_PERMISSION" and extra field "missing_permission" with "read.something" value.
Migration to V4
smart-error
module is as peer dependency. It needs to be installed separately.