New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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 - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "oh-my-errors",
"version": "1.0.0",
"version": "1.0.1",
"description": "Simple node module to handle multiple server-side errors with solution strategies",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -0,6 +1,31 @@

# Oh my errors!
[List of errors](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#5xx_Server_error)
Simple node module to handle multiple server-side errors with solution strategies.
# Possible errors
## How to use it
```javascript
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
| Method | Parameters |
|----------|:-------------------:|
| 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](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#5xx_Server_error)
* 400 -> BadRequest (any params or whatever is bad)

@@ -10,1 +35,6 @@ * 401 -> UnauthorizedError (like 403, but in cases when you need to login)

* 501 -> NotImplementedError
## Contribute!
* Bugs, Pull Requests or feature requests? Go here! [avatar-me Github repository](https://github.com/ferreiro/avatar-me/issues)
* Or... Send me an email jorge [AT] ferreiro [DOT] me
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