Skip to content

Commit bf06587

Browse files
committed
Update users.service.ts
1 parent dbccc3b commit bf06587

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/users/users.service.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,8 @@ export class UsersService {
3232

3333
return new UserLoginResponseDto(userData, null);
3434
} catch (err) {
35-
if (err.original.constraint === 'user_email_key') {
36-
throw new HttpException(`User with email '${err.errors[0].value}' already exists`, HttpStatus.CONFLICT);
37-
}
3835

39-
throw new HttpException(err, HttpStatus.INTERNAL_SERVER_ERROR);
36+
throw new HttpException(err.message, HttpStatus.INTERNAL_SERVER_ERROR);
4037
}
4138
}
4239

0 commit comments

Comments
 (0)