1.0.3 • Published 3 years ago

mec-errors v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

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

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago