1.3.0 • Published 5 years ago

@flagcard/exception v1.3.0

Weekly downloads
6
License
ISC
Repository
github
Last release
5 years ago

@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.

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.0.1

5 years ago

0.0.2

5 years ago