Przeglądaj źródła

Handle valueTooLong error when sending text message

This error is non-standard and should not happen if the message size is
calculated properly. However, in case it does still happen (due to a
bug), show a better error message than just "an error happened".
Danilo Bargen 5 lat temu
rodzic
commit
d6917d187c
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      src/services/webclient.ts

+ 3 - 1
src/services/webclient.ts

@@ -1926,10 +1926,12 @@ export class WebClientService {
             // Determine error message
             let errorMessage;
             switch (error) {
-                case 'file_too_large': // TODO: deprecated
                 case 'fileTooLarge':
                     errorMessage = this.$translate.instant('error.FILE_TOO_LARGE_GENERIC');
                     break;
+                case 'valueTooLong':
+                    errorMessage = this.$translate.instant('validationError.modifyReceiver.valueTooLong');
+                    break;
                 case 'blocked':
                     errorMessage = this.$translate.instant('error.CONTACT_BLOCKED');
                     break;