mec-errors
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Mecanizou Custom Errors Wrapper

This module adds custom errors types that you can abstract to specific errors in your application

Basic usage

const { InternalError } = require('mec-errors');

module.exports = function(){
    try {
        //...
    } catch (error) {
        throw new InternalError('some error');
    }

//...

}

Available errors

BadRequestError, returns message with statusCode 400

NotAllowedError, returns message with statusCode 403

NotFoundError, returns message with statusCode 404

InternalError, returns message with statusCode 500

ExternalError, returns message with statusCode 503

Dependents (0)

Package Sidebar

Install

npm i mec-errors

Weekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

13.5 kB

Total Files

22

Last publish

Collaborators

  • giogiannichi