resolve conflict

This commit is contained in:
Marshal
2026-07-07 22:24:42 +00:00
parent 70a917510e
commit 88b1e548a2
4 changed files with 359 additions and 141 deletions

View File

@@ -72,8 +72,14 @@ export class OtpService {
message: "OTP sent successfully",
};
} catch (error) {
console.log(error);
// Log the real cause (DB/SMS/email failure) with its stack so a deployed
// "Failed to send OTP" 400 is diagnosable from the API logs, not opaque.
this.logger.error(
`Failed to send OTP to ${target.email ?? target.phone}: ${
error instanceof Error ? error.message : String(error)
}`,
error instanceof Error ? error.stack : undefined,
);
throw new BadRequestException("Failed to send OTP");
}
}