Adding error handling
Some checks failed
Music Collection CI Workflow / test (./backend) (push) Failing after 28s
Music Collection CI Workflow / test (./frontend) (push) Successful in 38s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/music-collection-backend, ./backend) (push) Has been skipped
Music Collection CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/music-collection-frontend, ./frontend) (push) Has been skipped
Music Collection CI Workflow / deploy (push) Has been skipped
Some checks failed
Music Collection CI Workflow / test (./backend) (push) Failing after 28s
Music Collection CI Workflow / test (./frontend) (push) Successful in 38s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/music-collection-backend, ./backend) (push) Has been skipped
Music Collection CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/music-collection-frontend, ./frontend) (push) Has been skipped
Music Collection CI Workflow / deploy (push) Has been skipped
This commit is contained in:
parent
9ae0b1dc2f
commit
eb594e79d2
@ -13,7 +13,16 @@ async function bootstrap() {
|
|||||||
allowedHeaders:
|
allowedHeaders:
|
||||||
'X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept, Observe',
|
'X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept, Observe',
|
||||||
});
|
});
|
||||||
app.useGlobalPipes(new ValidationPipe({ transform: true }));
|
app.useGlobalPipes(new ValidationPipe({
|
||||||
|
transform: true,
|
||||||
|
exceptionFactory: (errors) => {
|
||||||
|
const result = errors.map((error) => ({
|
||||||
|
property: error.property,
|
||||||
|
message: error.constraints[Object.keys(error.constraints)[0]],
|
||||||
|
}));
|
||||||
|
return new UnprocessableEntityException(result);
|
||||||
|
},
|
||||||
|
}));
|
||||||
await app.listen(process.env.PORT ?? 3000);
|
await app.listen(process.env.PORT ?? 3000);
|
||||||
}
|
}
|
||||||
bootstrap();
|
bootstrap();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user