Skip to content

gitsindonesia/common-js

Repository files navigation

Common JS

Common Library from Gits Indonesia. Purpose to implement reusable code.

Current Features

  • throw Error for HTTP

Usage

try{
	throw new ErrorHTTP(400, "Bad request");
}catch (error){
	console.error(error)
}
try{
	throw new ErrorHTTPBadRequest("Validation Error");
}catch (error){
	console.error(error)
}

Other error exception can be used:

  • ErrorHTTPUnauthorized
  • ErrorHTTPForbidden
  • ErrorHTTPNotFound
  • ErrorHTTPServerError
  • ErrorHTTPBadGateway

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published