diff --git a/src/filters/query-failed.filter.ts b/src/filters/unique-constraint-violation.filter.ts similarity index 95% rename from src/filters/query-failed.filter.ts rename to src/filters/unique-constraint-violation.filter.ts index 55aba14..6e17856 100644 --- a/src/filters/query-failed.filter.ts +++ b/src/filters/unique-constraint-violation.filter.ts @@ -7,7 +7,7 @@ import { Reflector } from '@nestjs/core'; import type { Response } from 'express'; @Catch(UniqueConstraintViolationException) -export class QueryFailedFilter +export class UniqueConstraintViolationFilter implements ExceptionFilter { constructor(public reflector: Reflector) {} diff --git a/src/main.ts b/src/main.ts index 6999923..48e81f6 100644 --- a/src/main.ts +++ b/src/main.ts @@ -20,7 +20,7 @@ import { setupSwagger } from './setup-swagger'; import { ApiConfigService } from './shared/services/api-config.service'; import { TranslationService } from './shared/services/translation.service'; import { SharedModule } from './shared/shared.module'; -import { QueryFailedFilter } from './filters/query-failed.filter.ts'; +import { UniqueConstraintViolationFilter } from './filters/unique-constraint-violation.filter.ts'; export async function bootstrap(): Promise { const app = await NestFactory.create( @@ -39,7 +39,7 @@ export async function bootstrap(): Promise { app.useGlobalFilters( new HttpExceptionFilter(reflector), - new QueryFailedFilter(reflector), + new UniqueConstraintViolationFilter(reflector), ); app.useGlobalInterceptors(