@liidow/ajitrackcrash
v1.0.3
Published
A package for handling exceptions and sending notifications in NestJS projects.
Downloads
6
Readme
@liidow/all-exceptions-filter
A package for handling exceptions and sending notifications in NestJS projects.
Table of Contents
Installation
You can install the package via npm or yarn:
npm install @liidow/ajitrackcrash
# or
yarn add @liidow/ajitrackcrash
Usage
1. Import AllExceptionsFilter
Import AllExceptionsFilter
and use it as a global filter in your NestJS application:
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { HttpException, HttpStatus } from '@nestjs/common';
import { AllExceptionsFilter } from '@liidow/ajitrackcrash';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
// Enable CORS if needed
app.enableCors();
// Use AllExceptionsFilter as a global filter
app.useGlobalFilters(new AllExceptionsFilter("YourProjectName"));
await app.listen(3000);
}
bootstrap();
Replace "YourProjectName" with the actual name of your project or application
2. Customize AllExceptionsFilter
You can customize AllExceptionsFilter
by providing your project name:
import { AllExceptionsFilter } from '@liidow/ajitrackcrash';
// Use AllExceptionsFilter with custom project name and webhook URL
app.useGlobalFilters(new AllExceptionsFilter("YourProjectName"));
Configuration
Available Options
- projectName: The name of your NestJS project or application.
License
This project is licensed under the ISC License - see the LICENSE file for details.
Author
- Walid Hammioui - Owner and creator of
@liidow/ajitrackcrash