mirror of
https://github.com/dart-lang/sdk
synced 2024-07-20 18:05:01 +00:00
Fix unhandled exception in _HttpClientConnection after removing dynamic.
Change-Id: If838ce8f479986a488eb38b90b381c78956f5f6d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265188 Commit-Queue: Kallen Tu <kallentu@google.com> Reviewed-by: Lasse Nielsen <lrn@google.com>
This commit is contained in:
parent
18acd0e44c
commit
3fe9cb8bae
|
@ -2077,9 +2077,16 @@ class _HttpClientConnection {
|
|||
_nextResponseCompleter = null;
|
||||
}
|
||||
}, onError: (dynamic error, StackTrace stackTrace) {
|
||||
if (error is! HttpException) throw error; // Rethrow.
|
||||
String message;
|
||||
if (error is HttpException) {
|
||||
message = error.message;
|
||||
} else if (error is SocketException) {
|
||||
message = error.message;
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
_nextResponseCompleter?.completeError(
|
||||
HttpException(error.message, uri: _currentUri), stackTrace);
|
||||
HttpException(message, uri: _currentUri), stackTrace);
|
||||
_nextResponseCompleter = null;
|
||||
}, onDone: () {
|
||||
_nextResponseCompleter?.completeError(HttpException(
|
||||
|
|
Loading…
Reference in a new issue