mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 12:19:16 +00:00
improvement: translated all backend errors messages
This commit is contained in:
@@ -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");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user