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

Unified Diff: sdk/lib/_internal/pub/lib/src/http.dart

Issue 317633007: Report 500 errors more gracefully. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove debug code. Created 6 years, 6 months 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: sdk/lib/_internal/pub/lib/src/http.dart
diff --git a/sdk/lib/_internal/pub/lib/src/http.dart b/sdk/lib/_internal/pub/lib/src/http.dart
index 7f926b3348d887f866cdf06435120ba8585943e0..13f87afd91f1a69c231048551bc184439ac12aa9 100644
--- a/sdk/lib/_internal/pub/lib/src/http.dart
+++ b/sdk/lib/_internal/pub/lib/src/http.dart
@@ -87,6 +87,21 @@ class PubHttpClient extends http.BaseClient {
"Upgrade pub to the latest version and try again.");
}
+ if (status == 500 &&
+ (request.url.host == "pub.dartlang.org" ||
+ request.url.host == "storage.googleapis.com")) {
+ var message = "HTTP error 500: Internal Server Error at "
+ "${request.url}.";
+
+ if (request.url.host == "pub.dartlang.org" ||
+ request.url.host == "storage.googleapis.com") {
+ message += "\nThis is likely a transient error. Please try again "
+ "later.";
+ }
+
+ fail(message);
+ }
+
return http.Response.fromStream(streamedResponse).then((response) {
throw new PubHttpException(response);
});
« 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