fix: add logger for errors, return correct error when resume is locked

This commit is contained in:
Amruth Pillai
2023-11-22 22:25:54 +01:00
parent 27758c72e3
commit 4baecb22e9
4 changed files with 23 additions and 3 deletions

View File

@ -3,6 +3,7 @@ import {
ForbiddenException,
Injectable,
InternalServerErrorException,
Logger,
} from "@nestjs/common";
import { ConfigService } from "@nestjs/config";
import { JwtService } from "@nestjs/jwt";
@ -115,6 +116,7 @@ export class AuthService {
throw new BadRequestException(ErrorMessage.UserAlreadyExists);
}
Logger.error(error);
throw new InternalServerErrorException(error);
}
}
@ -213,6 +215,7 @@ export class AuthService {
await this.mailService.sendEmail({ to: email, subject, text });
} catch (error) {
Logger.error(error);
throw new InternalServerErrorException(error);
}
}