Change handling of (token) errors due to #1706

This commit is contained in:
the-djmaze 2024-08-16 22:05:15 +02:00
parent 02ea6c4359
commit d00c953c88
25 changed files with 80 additions and 69 deletions

View file

@ -499,8 +499,8 @@ export class ComposePopupView extends AbstractViewPopup {
const sendFailed = (iError, data) => {
this.sendError(true);
this.sendErrorDesc(
getNotification(iError, data?.ErrorMessage, Notifications.CantSendMessage)
+ "\n" + (data?.ErrorMessageAdditional || data?.ErrorMessage)
getNotification(iError, data?.message, Notifications.CantSendMessage)
+ "\n" + (data?.messageAdditional || data?.message)
);
};
try {
@ -530,8 +530,8 @@ export class ComposePopupView extends AbstractViewPopup {
if (Notifications.CantSaveMessage === iError) {
this.sendSuccessButSaveError(true);
let msg = i18n('COMPOSE/SAVED_ERROR_ON_SEND');
if (data?.ErrorMessageAdditional) {
msg = msg + "\n" + data?.ErrorMessageAdditional;
if (data?.messageAdditional) {
msg = msg + "\n" + data?.messageAdditional;
}
this.savedErrorDesc(msg);
} else {
@ -1151,7 +1151,7 @@ export class ComposePopupView extends AbstractViewPopup {
.on('onComplete', (id, result, data) => {
const attachment = this.getAttachmentById(id),
response = data?.Result || {},
errorCode = response.ErrorCode,
errorCode = response.code,
attachmentJson = result && response.Attachment;
let error = '';
@ -1167,7 +1167,7 @@ export class ComposePopupView extends AbstractViewPopup {
.waiting(false)
.uploading(false)
.complete(true)
.error(error + '\n' + response.ErrorMessage);
.error(error + '\n' + response.message);
} else if (attachmentJson) {
attachment
.waiting(false)