Skip to content

Commit 2eea635

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 bdd625d commit 2eea635

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
@@ -1065,8 +1065,7 @@ class UpdateMachine {
10651065
case Server5xxException():
10661066
shouldReportToUser = true;
10671067

1068-
case ServerException(httpStatus: 429):
1069-
case ZulipApiException(httpStatus: 429):
1068+
case HttpException(httpStatus: 429):
10701069
case ZulipApiException(code: 'RATE_LIMIT_HIT'):
10711070
// TODO(#946) handle rate-limit errors more generally, in ApiConnection
10721071
shouldReportToUser = true;

0 commit comments

Comments
 (0)