From d9e8840a5d4ee0723d6fab6824c5de0b5e63ccdd Mon Sep 17 00:00:00 2001 From: Gianfranco Frau Date: Wed, 7 Oct 2020 18:55:00 +0200 Subject: [PATCH] fix(core): handle file upload promise reject --- interaction/app/default/src/strings.json | 13 +++++++++++++ .../core/src/lib/services/contact-wrap.service.ts | 8 +++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/interaction/app/default/src/strings.json b/interaction/app/default/src/strings.json index 24676abb..fbee816c 100644 --- a/interaction/app/default/src/strings.json +++ b/interaction/app/default/src/strings.json @@ -5537,5 +5537,18 @@ "state": "final" } } + }, + { + "id": "STRINGS.MESSAGES.SERVER_REJECTED_UPLOAD", + "values": { + "it": { + "value": "Upload non completato: il file non รจ stato accettato dal server", + "state": "final" + }, + "en": { + "value": "Upload error: the file has been rejected by the server", + "state": "final" + } + } } ] diff --git a/interaction/lib/core/src/lib/services/contact-wrap.service.ts b/interaction/lib/core/src/lib/services/contact-wrap.service.ts index d82f2b31..b1d4de49 100644 --- a/interaction/lib/core/src/lib/services/contact-wrap.service.ts +++ b/interaction/lib/core/src/lib/services/contact-wrap.service.ts @@ -1255,7 +1255,13 @@ export class VvcContactWrap { this.zone.run(() => { this.uiService.setUploaded(); }); - }); + }).catch(err => { + this.logger.error('contact.attach error', err); + this.zone.run(() => { + this.uiService.setUploaded(); + this.messageService.sendSystemMessage('STRINGS.MESSAGES.SERVER_REJECTED_UPLOAD'); + }); + }) } sendIsWriting() { if (!this.autoChat && this.contact) {