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

Unified Diff: mojo/shell/dynamic_application_loader.cc

Issue 735863002: Emit an error log line when attempting to connect to an app at an invalid URL. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 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
Index: mojo/shell/dynamic_application_loader.cc
diff --git a/mojo/shell/dynamic_application_loader.cc b/mojo/shell/dynamic_application_loader.cc
index e1baea487dd0ed42dd5a15cc3fab5e2291bca6e9..c982a9cc73988bcd95abc116035822352453f612 100644
--- a/mojo/shell/dynamic_application_loader.cc
+++ b/mojo/shell/dynamic_application_loader.cc
@@ -160,9 +160,15 @@ class DynamicApplicationLoader::NetworkLoader : public Loader {
private:
void OnLoadComplete(URLResponsePtr response) {
if (response->error) {
- LOG(ERROR) << "Error (" << response->error->code << ": "
- << response->error->description << ") while fetching "
- << response->url;
+ if (response->url->is_valid()) {
+ LOG(ERROR) << "Error (" << response->error->code << ": "
+ << response->error->description << ") while fetching "
+ << response->url;
+ } else {
+ // If the URL was not valid, it's not possible to get the spec.
Aaron Boodman 2014/11/19 20:29:28 I think you can use possibly_invalid_spec() here.
azani 2014/11/19 23:08:54 Nope. Also returns an empty string. It looks like
+ LOG(ERROR) << "Error (" << response->error->code << ": "
+ << response->error->description << ")";
+ }
LoaderComplete();
return;
}

Powered by Google App Engine
This is Rietveld 408576698