Skip to content

Commit 29bf377

Browse files
committed
wip better message for handleEvent failure
1 parent 87fa1a9 commit 29bf377

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

assets/l10n/app_en.arb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,19 @@
172172
"error": {"type": "String", "example": "Invalid format"}
173173
}
174174
},
175+
"errorHandlingEventTitle": "Error handling a Zulip event. Retrying connection…",
176+
"@errorHandlingEventTitle": {
177+
"description": "Error title on failing to handle a Zulip server event."
178+
},
179+
"errorHandlingEventDetails": "Error handling a Zulip event from {serverUrl}; will retry.\n\nError: {error}\n\nEvent: {event}",
180+
"@errorHandlingEventDetails": {
181+
"description": "Error details on failing to handle a Zulip server event.",
182+
"placeholders": {
183+
"serverUrl": {"type": "String", "example": "https://chat.example.com"},
184+
"error": {"type": "String", "example": "Unexpected null value"},
185+
"event": {"type": "String", "example": "UpdateMessageEvent(id: 123, messageIds: [2345, 3456], newTopic: 'dinner')"}
186+
}
187+
},
175188
"errorSharingFailed": "Sharing failed",
176189
"@errorSharingFailed": {
177190
"description": "Error message when sharing a message failed."

lib/model/store.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,11 @@ class UpdateMachine {
10501050
assert(debugLog('BUG: Error handling an event: $cause\n' // TODO(log)
10511051
' event: $event\n'
10521052
'Replacing event queue…'));
1053-
_reportToUserErrorConnectingToServer(e); // TODO better message
1053+
reportErrorToUserBriefly(
1054+
GlobalLocalizations.zulipLocalizations.errorHandlingEventTitle,
1055+
details: GlobalLocalizations.zulipLocalizations.errorHandlingEventDetails(
1056+
store.connection.realmUrl.toString(),
1057+
cause.toString(), event.toString()));
10541058
// We can't just continue with the next event, because our state
10551059
// may be garbled due to failing to apply this one (and worse,
10561060
// any invariants that were left in a broken state from where

0 commit comments

Comments
 (0)