Skip to content

Commit 531af69

Browse files
committed
store [nfc]: Use HttpException to simplify error cases
This expresses more directly what we really mean here: if the response had either the HTTP status code or the Zulip API error code that mean a rate-limit error, treat it as a rate-limit error.
1 parent 4b937bb commit 531af69

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/model/store.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,8 +1128,7 @@ class UpdateMachine {
11281128
case Server5xxException():
11291129
shouldReportToUser = true;
11301130

1131-
case ServerException(httpStatus: 429):
1132-
case ZulipApiException(httpStatus: 429):
1131+
case HttpException(httpStatus: 429):
11331132
case ZulipApiException(code: 'RATE_LIMIT_HIT'):
11341133
// TODO(#946) handle rate-limit errors more generally, in ApiConnection
11351134
shouldReportToUser = true;

0 commit comments

Comments
 (0)