add log to show proper error message

This commit is contained in:
KMKoushik
2025-05-21 09:26:44 +10:00
parent 89bf97488e
commit 1b4a2a8803

View File

@@ -28,15 +28,14 @@ export async function validateDomainFromEmail(email: string, teamId: number) {
if (!domain) { if (!domain) {
throw new UnsendApiError({ throw new UnsendApiError({
code: "BAD_REQUEST", code: "BAD_REQUEST",
message: message: `Domain: ${fromDomain} of from email is wrong. Use the domain verified by unsend`,
"Domain of from email is wrong. Use the domain verified by unsend",
}); });
} }
if (domain.status !== "SUCCESS") { if (domain.status !== "SUCCESS") {
throw new UnsendApiError({ throw new UnsendApiError({
code: "BAD_REQUEST", code: "BAD_REQUEST",
message: "Domain is not verified", message: `Domain: ${fromDomain} is not verified`,
}); });
} }