mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
Revert "Cast errors to HttpExceptions and add lint to convert to tidy up dynamic calls in core libraries."
This reverts commit 5b7bd563d3
.
Reason for revert: Broke VM tests, not always HttpException.
Original change's description:
> Cast errors to HttpExceptions and add lint to convert to tidy up dynamic calls in core libraries.
>
> Change-Id: I7ea73b232d13baf84e834d742ebc16f2a081e727
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262626
> Commit-Queue: Kallen Tu <kallentu@google.com>
> Reviewed-by: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>
TBR=lrn@google.com,leafp@google.com,kallentu@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: I1777750c07b84b267d0b62dbfe93d54a6bfee7ae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263180
Reviewed-by: Leaf Petersen <leafp@google.com>
This commit is contained in:
parent
c8799b3e44
commit
7e1890d78b
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"org-dartlang-sdk:///lib/_http/http_impl.dart": {
|
||||
"Dynamic access of 'message'.": 3,
|
||||
"Dynamic access of 'address'.": 1,
|
||||
"Dynamic access of 'port'.": 1,
|
||||
"Dynamic invocation of 'listen'.": 1,
|
||||
|
|
|
@ -438,8 +438,8 @@ class _HttpIncoming extends Stream<Uint8List> {
|
|||
{Function? onError, void Function()? onDone, bool? cancelOnError}) {
|
||||
hasSubscriber = true;
|
||||
return _stream.handleError((error) {
|
||||
throw HttpException((error as HttpException).message, uri: uri);
|
||||
}, test: (error) => error is HttpException).listen(onData,
|
||||
throw HttpException(error.message, uri: uri);
|
||||
}).listen(onData,
|
||||
onError: onError, onDone: onDone, cancelOnError: cancelOnError);
|
||||
}
|
||||
|
||||
|
@ -2062,18 +2062,16 @@ class _HttpClientConnection {
|
|||
_subscription!.resume();
|
||||
}).catchError((dynamic error, StackTrace stackTrace) {
|
||||
_nextResponseCompleter!.completeError(
|
||||
HttpException((error as HttpException).message, uri: _currentUri),
|
||||
stackTrace);
|
||||
HttpException(error.message, uri: _currentUri), stackTrace);
|
||||
_nextResponseCompleter = null;
|
||||
}, test: (error) => error is HttpException);
|
||||
});
|
||||
} else {
|
||||
_nextResponseCompleter!.complete(incoming);
|
||||
_nextResponseCompleter = null;
|
||||
}
|
||||
}, onError: (dynamic error, StackTrace stackTrace) {
|
||||
_nextResponseCompleter?.completeError(
|
||||
HttpException((error as HttpException).message, uri: _currentUri),
|
||||
stackTrace);
|
||||
HttpException(error.message, uri: _currentUri), stackTrace);
|
||||
_nextResponseCompleter = null;
|
||||
}, onDone: () {
|
||||
_nextResponseCompleter?.completeError(HttpException(
|
||||
|
|
|
@ -622,7 +622,7 @@ class JsonDecoder extends Converter<String, Object?> {
|
|||
external dynamic _parseJson(String source, reviver(key, value)?);
|
||||
|
||||
// Implementation of encoder/stringifier.
|
||||
// ignore: avoid_dynamic_calls
|
||||
|
||||
dynamic _defaultToEncodable(dynamic object) => object.toJson();
|
||||
|
||||
/// JSON encoder that traverses an object structure and writes JSON source.
|
||||
|
|
Loading…
Reference in a new issue