Skip to content

Commit

Permalink
adjust(CC-81): adjust error treatment and test
Browse files Browse the repository at this point in the history
  • Loading branch information
luanavfg committed Nov 17, 2023
1 parent 230a835 commit 484feca
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 @@ -112,7 +112,7 @@ describe('[E2E] - Create Clinic', () => {
.set('Authorization', `Bearer ${access_token}`)
.send(clinic);

expect(createdClinicResponse.statusCode).toBe(500);
expect(createdClinicResponse.body.message).contain('An error occurred while processing your request');
expect(createdClinicResponse.statusCode).toBe(400);
expect(createdClinicResponse.body.message).contain("Invalid `this.postgreSqlPrismaOrmService['clinic'].create()`");
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class GlobalAppHttpException {
exceptionMessage += ` Prisma Error Code: ${error.code}.`;
}

if (error.code === 'P2002') {
if (error.code === 'P2002' || error.code === 'P2003') {
// Remover linhas e espaços extras
const relevantLines = error.message
.split('\n')
Expand Down

0 comments on commit 484feca

Please sign in to comment.