Harmonize error handling, ignore 404 (for now)

This commit is contained in:
Sebastian Wolf 2020-11-16 14:37:14 +01:00
parent e950ce7c25
commit aeca799006
14 changed files with 58 additions and 98 deletions

View file

@ -394,3 +394,15 @@ function getMessagesArrayText(messages) {
} }
return lines.join("\n"); return lines.join("\n");
} }
function handleErrorMessage(code, message) {
if (code === 404) {
// Silently ignore 404 Not Found messages (occur sometimes, without clear context...)
return;
}
if (message === "USER_ALREADY_PARTICIPANT") {
appNotification.show(qsTr("You are already a member of this chat."));
} else {
appNotification.show(message);
}
}

View file

@ -341,11 +341,7 @@ Page {
chatPage.emojiProposals = result; chatPage.emojiProposals = result;
} }
onErrorReceived: { onErrorReceived: {
if (message === "USER_ALREADY_PARTICIPANT") { Functions.handleErrorMessage(code, message);
appNotification.show(qsTr("You are already a member of this chat."));
} else {
appNotification.show(message);
}
} }
} }

View file

@ -160,11 +160,7 @@ Page {
} }
} }
onErrorReceived: { onErrorReceived: {
if (message === "USER_ALREADY_PARTICIPANT") { Functions.handleErrorMessage(code, message);
appNotification.show(qsTr("You are already a member of this chat."));
} else {
appNotification.show(message);
}
} }
} }

View file

@ -347,10 +347,6 @@
<numerusform>%n Nachrichten weiterleiten</numerusform> <numerusform>%n Nachrichten weiterleiten</numerusform>
</translation> </translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation>Sie sind bereits Mitglied dieses Chats.</translation>
</message>
</context> </context>
<context> <context>
<name>ChatSelectionPage</name> <name>ChatSelectionPage</name>
@ -900,10 +896,6 @@
<source>You don&apos;t have any chats yet.</source> <source>You don&apos;t have any chats yet.</source>
<translation>Sie haben noch keine Chats.</translation> <translation>Sie haben noch keine Chats.</translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation>Sie sind bereits Mitglied dieses Chats.</translation>
</message>
</context> </context>
<context> <context>
<name>PollCreationPage</name> <name>PollCreationPage</name>
@ -1530,5 +1522,9 @@
<source>sent a video note</source> <source>sent a video note</source>
<translation>hat eine Videonachricht geschickt</translation> <translation>hat eine Videonachricht geschickt</translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation>Sie sind bereits Mitglied dieses Chats.</translation>
</message>
</context> </context>
</TS> </TS>

View file

@ -347,10 +347,6 @@
<numerusform>Forward %n messages</numerusform> <numerusform>Forward %n messages</numerusform>
</translation> </translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation type="unfinished">You are already a member of this chat.</translation>
</message>
</context> </context>
<context> <context>
<name>ChatSelectionPage</name> <name>ChatSelectionPage</name>
@ -900,10 +896,6 @@
<source>You don&apos;t have any chats yet.</source> <source>You don&apos;t have any chats yet.</source>
<translation>You don&apos;t have any chats yet.</translation> <translation>You don&apos;t have any chats yet.</translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation>You are already a member of this chat.</translation>
</message>
</context> </context>
<context> <context>
<name>PollCreationPage</name> <name>PollCreationPage</name>
@ -1530,5 +1522,9 @@
<source>sent a video note</source> <source>sent a video note</source>
<translation>sent a video note</translation> <translation>sent a video note</translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation>You are already a member of this chat.</translation>
</message>
</context> </context>
</TS> </TS>

View file

@ -343,10 +343,6 @@
<numerusform>Reenviar %n mensajes</numerusform> <numerusform>Reenviar %n mensajes</numerusform>
</translation> </translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation>Ya eres miembro de este grupo.</translation>
</message>
</context> </context>
<context> <context>
<name>ChatSelectionPage</name> <name>ChatSelectionPage</name>
@ -896,10 +892,6 @@
<source>You don&apos;t have any chats yet.</source> <source>You don&apos;t have any chats yet.</source>
<translation>No hay todavía ninguna charla.</translation> <translation>No hay todavía ninguna charla.</translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation>Ya eres miembro de este grupo.</translation>
</message>
</context> </context>
<context> <context>
<name>PollCreationPage</name> <name>PollCreationPage</name>
@ -1520,5 +1512,9 @@
<source>sent a video note</source> <source>sent a video note</source>
<translation>envió una nota de video</translation> <translation>envió una nota de video</translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation>Ya eres miembro de este grupo.</translation>
</message>
</context> </context>
</TS> </TS>

View file

@ -347,10 +347,6 @@
<numerusform></numerusform> <numerusform></numerusform>
</translation> </translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation type="unfinished">Olet jo tämän ryhmän jäsen.</translation>
</message>
</context> </context>
<context> <context>
<name>ChatSelectionPage</name> <name>ChatSelectionPage</name>
@ -901,10 +897,6 @@
<source>You don&apos;t have any chats yet.</source> <source>You don&apos;t have any chats yet.</source>
<translation>Sinulla ei ole vielä keskusteluja.</translation> <translation>Sinulla ei ole vielä keskusteluja.</translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation>Olet jo tämän ryhmän jäsen.</translation>
</message>
</context> </context>
<context> <context>
<name>PollCreationPage</name> <name>PollCreationPage</name>
@ -1531,5 +1523,9 @@
<source>sent a video note</source> <source>sent a video note</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation>Olet jo tämän ryhmän jäsen.</translation>
</message>
</context> </context>
</TS> </TS>

View file

@ -343,10 +343,6 @@
<numerusform></numerusform> <numerusform></numerusform>
</translation> </translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ChatSelectionPage</name> <name>ChatSelectionPage</name>
@ -896,10 +892,6 @@
<source>You don&apos;t have any chats yet.</source> <source>You don&apos;t have any chats yet.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>PollCreationPage</name> <name>PollCreationPage</name>
@ -1520,5 +1512,9 @@
<source>sent a video note</source> <source>sent a video note</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>

View file

@ -347,10 +347,6 @@
<numerusform></numerusform> <numerusform></numerusform>
</translation> </translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation type="unfinished">Sei già membro di questa chat.</translation>
</message>
</context> </context>
<context> <context>
<name>ChatSelectionPage</name> <name>ChatSelectionPage</name>
@ -900,10 +896,6 @@
<source>Loading chat list...</source> <source>Loading chat list...</source>
<translation>Carica lista chat...</translation> <translation>Carica lista chat...</translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation>Sei già membro di questa chat.</translation>
</message>
</context> </context>
<context> <context>
<name>PollCreationPage</name> <name>PollCreationPage</name>
@ -1530,5 +1522,9 @@
<source>sent a video note</source> <source>sent a video note</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation>Sei già membro di questa chat.</translation>
</message>
</context> </context>
</TS> </TS>

View file

@ -351,10 +351,6 @@
<numerusform></numerusform> <numerusform></numerusform>
</translation> </translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ChatSelectionPage</name> <name>ChatSelectionPage</name>
@ -904,10 +900,6 @@
<source>You don&apos;t have any chats yet.</source> <source>You don&apos;t have any chats yet.</source>
<translation type="unfinished">Nie masz jeszcze żadnych czatów.</translation> <translation type="unfinished">Nie masz jeszcze żadnych czatów.</translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>PollCreationPage</name> <name>PollCreationPage</name>
@ -1540,5 +1532,9 @@
<source>sent a video note</source> <source>sent a video note</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>

View file

@ -351,10 +351,6 @@
<numerusform></numerusform> <numerusform></numerusform>
</translation> </translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation type="unfinished">Вы уже в этом чате.</translation>
</message>
</context> </context>
<context> <context>
<name>ChatSelectionPage</name> <name>ChatSelectionPage</name>
@ -904,10 +900,6 @@
<source>You don&apos;t have any chats yet.</source> <source>You don&apos;t have any chats yet.</source>
<translation>Тут пока ничего нет</translation> <translation>Тут пока ничего нет</translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation>Вы уже в этом чате.</translation>
</message>
</context> </context>
<context> <context>
<name>PollCreationPage</name> <name>PollCreationPage</name>
@ -1540,5 +1532,9 @@
<source>sent a video note</source> <source>sent a video note</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation>Вы уже в этом чате.</translation>
</message>
</context> </context>
</TS> </TS>

View file

@ -347,10 +347,6 @@
<numerusform></numerusform> <numerusform></numerusform>
</translation> </translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation type="unfinished">Du är redan medlem i den här chatten.</translation>
</message>
</context> </context>
<context> <context>
<name>ChatSelectionPage</name> <name>ChatSelectionPage</name>
@ -900,10 +896,6 @@
<source>You don&apos;t have any chats yet.</source> <source>You don&apos;t have any chats yet.</source>
<translation>Du har inga chattar än.</translation> <translation>Du har inga chattar än.</translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation>Du är redan medlem i den här chatten.</translation>
</message>
</context> </context>
<context> <context>
<name>PollCreationPage</name> <name>PollCreationPage</name>
@ -1530,5 +1522,9 @@
<source>sent a video note</source> <source>sent a video note</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation>Du är redan medlem i den här chatten.</translation>
</message>
</context> </context>
</TS> </TS>

View file

@ -343,10 +343,6 @@
<numerusform></numerusform> <numerusform></numerusform>
</translation> </translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ChatSelectionPage</name> <name>ChatSelectionPage</name>
@ -896,10 +892,6 @@
<source>You don&apos;t have any chats yet.</source> <source>You don&apos;t have any chats yet.</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation></translation>
</message>
</context> </context>
<context> <context>
<name>PollCreationPage</name> <name>PollCreationPage</name>
@ -1520,5 +1512,9 @@
<source>sent a video note</source> <source>sent a video note</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation></translation>
</message>
</context> </context>
</TS> </TS>

View file

@ -343,10 +343,6 @@
<numerusform></numerusform> <numerusform></numerusform>
</translation> </translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ChatSelectionPage</name> <name>ChatSelectionPage</name>
@ -896,10 +892,6 @@
<source>You don&apos;t have any chats yet.</source> <source>You don&apos;t have any chats yet.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>PollCreationPage</name> <name>PollCreationPage</name>
@ -1520,5 +1512,9 @@
<source>sent a video note</source> <source>sent a video note</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>You are already a member of this chat.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>