Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(861)

Unified Diff: runtime/bin/builtin.dart

Issue 66623002: Provide better error message when the VM tries to load a script using HTTP (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/builtin.dart
diff --git a/runtime/bin/builtin.dart b/runtime/bin/builtin.dart
index 368b73ec740ef94d6ebf62d9e32edaf0ea2b6c30..9f241b18ae87284f8ab7a578bf6b1472f2506097 100644
--- a/runtime/bin/builtin.dart
+++ b/runtime/bin/builtin.dart
@@ -75,18 +75,22 @@ void _makeHttpRequest(String uri) {
_httpRequestResponseCode = 0;
_httpRequestStatusString = null;
_httpRequestResponse = null;
- Uri requestUri = Uri.parse(uri);
- _client.getUrl(requestUri)
- .then((HttpClientRequest request) => request.close())
- .then((HttpClientResponse response) {
- return response
- .fold(new BytesBuilder(), (b, d) => b..add(d))
- .then((builder) {
- _requestCompleted(builder.takeBytes(), response);
- });
- }).catchError((error) {
- _requestFailed(error);
- });
+ try {
+ Uri requestUri = Uri.parse(uri);
+ _client.getUrl(requestUri)
+ .then((HttpClientRequest request) => request.close())
+ .then((HttpClientResponse response) {
+ return response
+ .fold(new BytesBuilder(), (b, d) => b..add(d))
+ .then((builder) {
+ _requestCompleted(builder.takeBytes(), response);
+ });
+ }).catchError((error) {
+ _requestFailed(error);
+ });
+ } catch (error) {
+ _requestFailed(error);
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698