added a dedicated error handler service

This commit is contained in:
unknown
2024-10-04 22:04:19 +03:00
parent a311286430
commit 553f08641e
9 changed files with 130 additions and 7 deletions

View File

@ -6,6 +6,7 @@ import { setupSwaggerAuthentication } from '../libs/common/src/util/user-auth.sw
import { ValidationPipe } from '@nestjs/common';
import { json, urlencoded } from 'body-parser';
import { SeederService } from '@app/common/seed/services/seeder.service';
import { HttpExceptionFilter } from './common/filters/http-exception/http-exception.filter';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
@ -15,6 +16,7 @@ async function bootstrap() {
// Set the body parser limit to 1 MB
app.use(json({ limit: '1mb' }));
app.use(urlencoded({ limit: '1mb', extended: true }));
app.useGlobalFilters(new HttpExceptionFilter());
app.use(
rateLimit({