3.0.0 • Published 10 years ago

errorcode v3.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

errorcode

Translate error messages to errorcodes.

API Reference

Function to add status field to an error to be used with express.

errorcode~add(status, error) ⇒ Error

Deprecated

Add the status to an error.

Kind: inner method of errorcode
Returns: Error - error with the status.
Throws:

  • Error when missing any argument.
ParamTypeDescription
statusnumberhttp status code.
errorErrorthe error which the status will be appended.

errorcode~register(object)

Adds the current object to the dictionary

Kind: inner method of errorcode

ParamTypeDescription
objectobjectmapping a message to an errorcode

errorcode~get(error)

Gets the error code for the first word of the error message or 500

Kind: inner method of errorcode

ParamTypeDescription
errorobjectwith message

3.0.0

10 years ago

2.1.0

10 years ago

2.0.0

10 years ago

1.0.0

10 years ago