Skip to content

Commit cccf696

Browse files
committed
api [nfc]: Reorder NetworkException to before sibling classes
We're about to group the others together under a new sibling of this class, so it'll be cleanest if this one doesn't appear in the midst of the others.
1 parent 35d83f2 commit cccf696

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

lib/api/exception.dart

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,23 @@ sealed class ApiRequestException implements Exception {
2828
String toString() => message;
2929
}
3030

31+
/// A network-level error that prevented even getting an HTTP response.
32+
class NetworkException extends ApiRequestException {
33+
/// The exception describing the underlying error.
34+
///
35+
/// This can be any exception value that [http.Client.send] throws.
36+
/// Ideally that would always be an [http.ClientException],
37+
/// but empirically it can be [TlsException] and possibly others.
38+
final Object cause;
39+
40+
NetworkException({required super.routeName, required super.message, required this.cause});
41+
42+
@override
43+
String toString() {
44+
return 'NetworkException: $message ($cause)';
45+
}
46+
}
47+
3148
/// An error returned through the Zulip server API.
3249
///
3350
/// See API docs: https://zulip.com/api/rest-error-handling
@@ -69,23 +86,6 @@ class ZulipApiException extends ApiRequestException {
6986
}
7087
}
7188

72-
/// A network-level error that prevented even getting an HTTP response.
73-
class NetworkException extends ApiRequestException {
74-
/// The exception describing the underlying error.
75-
///
76-
/// This can be any exception value that [http.Client.send] throws.
77-
/// Ideally that would always be an [http.ClientException],
78-
/// but empirically it can be [TlsException] and possibly others.
79-
final Object cause;
80-
81-
NetworkException({required super.routeName, required super.message, required this.cause});
82-
83-
@override
84-
String toString() {
85-
return 'NetworkException: $message ($cause)';
86-
}
87-
}
88-
8989
/// Some kind of server-side error in handling the request.
9090
///
9191
/// This should always represent either some kind of operational issue

0 commit comments

Comments
 (0)