improvement: translated all backend errors messages

This commit is contained in:
canove
2020-10-13 22:53:05 -03:00
parent 558475f121
commit a567614c63
45 changed files with 308 additions and 120 deletions

View File

@@ -15,11 +15,9 @@ const CheckIsValidContact = async (number: string): Promise<void> => {
} catch (err) {
console.log(err);
if (err.message === "invalidNumber") {
throw new AppError("This is not a valid whatsapp number.");
throw new AppError("ERR_WAPP_INVALID_CONTACT");
}
throw new AppError(
"Could not valid WhatsApp contact. Check connections page"
);
throw new AppError("ERR_WAPP_CHECK_CONTACT");
}
};

View File

@@ -149,7 +149,7 @@ const handlMedia = async (
const media = await msg.downloadMedia();
if (!media) {
throw new AppError("Cannot download media from whatsapp.");
throw new AppError("ERR_WAPP_DOWNLOAD_MEDIA");
}
if (!media.filename) {