@flagcard/exception

1.3.0 • Public • Published

@flagcard/exception

Exception lib for projects in javascript

Table of Contents

Installation

@flagcard/exception is available from npm.

$ npm i -S @flagcard/exception

Why ?

Centralize exceptions used in microservices

Documentation

BadRequestException

const { BadRequestException } = require('@flagcard/exception');
throw new BadRequestException('custon message');

MethodNotAllowedException

const { MethodNotAllowedException } = require('@flagcard/exception');
throw new MethodNotAllowedException('custon message');

NotFoundException

const { NotFoundException } = require('@flagcard/exception');
throw new NotFoundException('custon message');

UnauthorizedUserException

const { UnauthorizedUserException } = require('@flagcard/exception');
throw new UnauthorizedUserException('custon message');

Custom Exception

const { Exception } = require('@flagcard/exception');
class CustomException extends Exception {
  constructor(message) {
    super(message);
    // do something fun
  }
}

License

The code is available under the MIT License.

Readme

Keywords

none

Package Sidebar

Install

npm i @flagcard/exception

Weekly Downloads

9

Version

1.3.0

License

ISC

Unpacked Size

10 kB

Total Files

18

Last publish

Collaborators

  • dayvison.lemos