10000 GitHub - benpptung/http-error: create error object with http status code for express
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

benpptung/http-error

Folders and files

NameName
Last commit message
Last commit date< 8000 /div>

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

http-error

npm install benpptung/http-error -S

Why

http-error is designed for the following reasons:

  • Server logging, when something wrong, we should know why, original property is designed for this

  • Hide server message for security reason and tell the user what you want to say, so reason, info are designed if Http status code is not enough

Usage

const 'http-error').OnBadGateway;


db.find(something, onError);

function onError(err) {

  callback(OnBadGateway(err));
}

About

create error object with http status code for express

Resources

Stars

Watchers

Forks

Packages

No packages published
0