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

Unified Diff: tools/gn/input_file_manager.cc

Issue 545313002: Make ui gn check pass. Misc GN build improvements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: link chrome Created 6 years, 3 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
Index: tools/gn/input_file_manager.cc
diff --git a/tools/gn/input_file_manager.cc b/tools/gn/input_file_manager.cc
index eb255080a9da68445cec8b3d03e4c612a7b6ae3a..f358fdc2e68420b19f9e65b6c34ab6f38560953e 100644
--- a/tools/gn/input_file_manager.cc
+++ b/tools/gn/input_file_manager.cc
@@ -215,11 +215,20 @@ const ParseNode* InputFileManager::SyncLoadFile(
}
}
- // The other load could have failed. In this case that error will be printed
- // to the console, but we need to return something here, so make up a
+ // The other load could have failed. In this case that error was probably
+ // printed to the console, but we need to return something here, so make up a
// dummy error.
- if (!data->parsed_root)
- *err = Err(origin, "File parse failed");
+ //
+ // There is a race condition. The other load could have failed, but if the
+ // other thread is delayed for some reason, this thread could end up
+ // reporting the error to the scheduler first (since first error report
+ // wins). The user will see this one and the "real" one will be discarded.
+ if (!data->parsed_root) {
+ *err = Err(origin, "File parse failed.",
+ "If you see this, I'm really sorry, but a race condition has caused\n"
+ "me to eat your error message. It was crunchy. If the parse error\n"
+ "in your imported file isn't obvious, try re-running GN.");
+ }
return data->parsed_root.get();
}

Powered by Google App Engine
This is Rietveld 408576698