|
|
|
@ -860,14 +860,14 @@ export const parseRenderMessageList = (messages) => {
|
|
|
|
|
msgContent.template = msg.msgtype === 'template' ? { ...msgContent.template, ...template } : {};
|
|
|
|
|
// const parseMethod = msgContent.bizType === 'whatsapp' ? cloneDeep(whatsappMsgTypeMapped) : {};
|
|
|
|
|
let waCode, waError = '';
|
|
|
|
|
if ((msgContent?.status || 'accepted') === 'failed' && msgContent.errorMessage && msg.msg_direction === 'outbound') {
|
|
|
|
|
(waCode = msgContent.errorMessage.match(/\(#(\d+)\)/));
|
|
|
|
|
(waError = (whatsappError?.[waCode?.[1]] || whatsappError?.[msgContent.errorCode] || msgContent.errorMessage));
|
|
|
|
|
if ((msgContent?.status || 'accepted') === 'failed' && (msgContent.errorMessage || msg.errors_code) && msg.msg_direction === 'outbound') {
|
|
|
|
|
(waCode = (msgContent.errorMessage || msg.errors_code).match(/\(#(\d+)\)/));
|
|
|
|
|
(waError = (whatsappError?.[waCode?.[1]] || whatsappError?.[msgContent.errorCode] || msgContent.errorMessage || whatsappError?.[msg.errors_code]));
|
|
|
|
|
if (!isEmpty(msgContent.whatsappApiError)) {
|
|
|
|
|
waError = whatsappError?.[msgContent.whatsappApiError.code] || msgContent.whatsappApiError.message;
|
|
|
|
|
// waError += `\n[${msgContent.errorCode}] ${whatsappError?.[msgContent.errorCode] || msgContent.errorMessage}`;
|
|
|
|
|
}
|
|
|
|
|
if (msgContent.errorMessage.includes('Invalid E.146 phone number')) {
|
|
|
|
|
if ((msgContent.errorMessage || msg.errors_code).includes('Invalid E.146 phone number')) {
|
|
|
|
|
waError = whatsappError.INVALID_PHONE_NUMBER;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -947,7 +947,7 @@ export const whatsappError = {
|
|
|
|
|
'100': '参数错误, 请联系技术组',
|
|
|
|
|
'FORBIDDEN': '[FORBIDDEN] ',
|
|
|
|
|
'4': '[4] 无法连接WhatsApp.\n请稍后重试', // (#4) Application request limit reached
|
|
|
|
|
'131026': '[131026] 消息无法投递(未同意WhatsApp 的隐私政策).\n请使用邮件联系',
|
|
|
|
|
'131026': '[131026] 消息无法投递(未同意WhatsApp 的隐私政策).\n请使用 邮件/个人WhatsApp 联系',
|
|
|
|
|
'131047': '[131047] 会话未激活. \n请使用模板消息💬发送',
|
|
|
|
|
'131053': '[131053] 文件上传失败.',
|
|
|
|
|
'131048': '[131048] 账户被风控.', // 消息发送太多, 达到垃圾数量限制
|
|
|
|
|