Skip to content

Commit 480e481

Browse files
jonahwilliamscommit-bot@chromium.org
authored andcommitted
Throw HttpException instead of String in http impl
This was noted in the flutter_tool crash reports, see flutter/flutter#38902, since we only catch specific exception types this ended up as an uncaught exception. I think the HttpException class seems reasonably appropriate for this class of error. Change-Id: I88801dfe558f5edb781513b0eb82f1544b980e89 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113962 Reviewed-by: Zach Anderson <[email protected]> Commit-Queue: Zach Anderson <[email protected]>
1 parent 9aa48c2 commit 480e481

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sdk/lib/_http/http_impl.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,8 +1836,10 @@ class _HttpClientConnection {
18361836
}
18371837
return request.close().then((response) {
18381838
if (response.statusCode != HttpStatus.ok) {
1839-
throw "Proxy failed to establish tunnel "
1840-
"(${response.statusCode} ${response.reasonPhrase})";
1839+
throw new HttpException(
1840+
"Proxy failed to establish tunnel "
1841+
"(${response.statusCode} ${response.reasonPhrase})",
1842+
uri: request.uri);
18411843
}
18421844
var socket = (response as _HttpClientResponse)
18431845
._httpRequest

0 commit comments

Comments
 (0)