From 27e2403264b65de5390b1360fc91b5855d26c903 Mon Sep 17 00:00:00 2001 From: Phill Pover Date: Mon, 7 Apr 2025 11:05:36 +0100 Subject: [PATCH] Pushing errors back to frontend --- backend/src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/main.ts b/backend/src/main.ts index 761f105..e9246d4 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -1,5 +1,5 @@ import { NestFactory } from '@nestjs/core'; -import { UnprocessableEntityException, ValidationError, ValidationPipe } from '@nestjs/common'; +import { BadRequestException, ValidationError, ValidationPipe } from '@nestjs/common'; import { AppModule } from './app.module'; async function bootstrap() { @@ -47,7 +47,7 @@ async function bootstrap() { return errors; }; const errors = getPrettyClassValidatorErrors(validationErrors); - return new UnprocessableEntityException({ + return new BadRequestException({ message: 'validation error', errors: errors, });