Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

oh-my-errors

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oh-my-errors

Simple node module to handle multiple server-side errors with solution strategies

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Oh my errors!

Simple node module to handle multiple server-side errors with solution strategies.

How to use it

const errorHandler = require('oh-my-errors')

const error404 = errorHandler.createNotFoundError404({
  origin: 'PLACE in your application where this error was originated',
  message: 'Resource not found'
})

API methods

MethodParameters
createNotImplementedError501 {String=} data.origin, {String=} data.message
createBadRequest400{String=} data.origin, {String=} data.message
createUnauthorizedError401{String=} data.origin, {String=} data.message
createForbiddenError403{String=} data.origin, {String=} data.message
createNotFoundError404{String=} data.origin, {String=} data.message
createInternalError500{String=} data.origin, {String=} data.message

Possible errors

We support the most commun errors from HTTP Status codes

  • 400 -> BadRequest (any params or whatever is bad)
  • 401 -> UnauthorizedError (like 403, but in cases when you need to login)
  • 404 -> NotFound (Resource not found. For example: user in the database, items, pages, etc...)
  • 501 -> NotImplementedError

Contribute!

Keywords

FAQs

Package last updated on 08 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc