4.0.0-alpha.42 • Published 3 months ago

@concepta/nestjs-exception v4.0.0-alpha.42

Weekly downloads
-
License
BSD-3-Clause
Repository
-
Last release
3 months ago

Rockets NestJS Exception

Provide exception handling/normalization and error code mapping.

For more details on the exception filters pattern, please refer to the official NestJS Exception Filters documentation.

Project

NPM Latest NPM Downloads GH Last Commit GH Contrib NestJS Dep

Installation

yarn add @concepta/nestjs-exception

Binding The Filer

You can bind the filter to classes, methods and globally.

Class Decorator

// ...
import { ExceptionsFilter } from '@concepta/nestjs-exception';

@UseFilters(new ExceptionsFilter())
export class PhotoController {
  // ...
}

Method Decorator

// ...
import { ExceptionsFilter } from '@concepta/nestjs-exception';

@Post()
@UseFilters(new ExceptionsFilter())
async create(@Body() createPhotoDto: CreatePhotoDto) {
  throw new ForbiddenException();
}

Global Filter

// ...
import { ExceptionsFilter } from '@concepta/nestjs-exception';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  app.useGlobalFilters(new ExceptionsFilter());
  await app.listen(3000);
}
bootstrap();

TODO

  • Define interface for exception filter response payload.
4.0.0-alpha.42

3 months ago

4.0.0-alpha.41

3 months ago

4.0.0-alpha.40

3 months ago

4.0.0-alpha.39

3 months ago

4.0.0-alpha.38

3 months ago

4.0.0-alpha.37

4 months ago

4.0.0-alpha.36

5 months ago

4.0.0-alpha.35

5 months ago

4.0.0-alpha.34

5 months ago

4.0.0-alpha.31

6 months ago

4.0.0-alpha.30

7 months ago

4.0.0-alpha.33

6 months ago

4.0.0-alpha.32

6 months ago

4.0.0-alpha.28

7 months ago

4.0.0-alpha.27

8 months ago

4.0.0-alpha.26

8 months ago

4.0.0-alpha.25

9 months ago

4.0.0-alpha.29

7 months ago

4.0.0-alpha.24

9 months ago

4.0.0-alpha.23

1 year ago

4.0.0-alpha.22

2 years ago

4.0.0-alpha.19

2 years ago

4.0.0-alpha.20

2 years ago

4.0.0-alpha.21

2 years ago

4.0.0-alpha.17

2 years ago

4.0.0-alpha.16

2 years ago

4.0.0-alpha.15

2 years ago

4.0.0-alpha.14

2 years ago

4.0.0-alpha.18

2 years ago

4.0.0-alpha.13

2 years ago

4.0.0-alpha.12

2 years ago

4.0.0-alpha.11

2 years ago

4.0.0-alpha.9

2 years ago

4.0.0-alpha.10

2 years ago

4.0.0-alpha.8

2 years ago

4.0.0-alpha.7

2 years ago

4.0.0-alpha.6

2 years ago