Skip to content

Commit

Permalink
fix(): fix QueryFailedFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
NarHakobyan committed Apr 1, 2024
1 parent d76512e commit 1358a58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Reflector } from '@nestjs/core';
import type { Response } from 'express';

@Catch(UniqueConstraintViolationException)
export class QueryFailedFilter
export class UniqueConstraintViolationFilter
implements ExceptionFilter<UniqueConstraintViolationException>
{
constructor(public reflector: Reflector) {}
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<NestExpressApplication> {
const app = await NestFactory.create<NestExpressApplication>(
Expand All @@ -39,7 +39,7 @@ export async function bootstrap(): Promise<NestExpressApplication> {

app.useGlobalFilters(
new HttpExceptionFilter(reflector),
new QueryFailedFilter(reflector),
new UniqueConstraintViolationFilter(reflector),
);

app.useGlobalInterceptors(
Expand Down

0 comments on commit 1358a58

Please sign in to comment.