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

Unified Diff: tools/gn/import_manager.cc

Issue 1905473003: 🐣 GN: Print the import trail when parse errors occur. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move is_null() to header Created 4 years, 8 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 | tools/gn/loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/import_manager.cc
diff --git a/tools/gn/import_manager.cc b/tools/gn/import_manager.cc
index 8c57008a339168739a4f4027475cfa3a1f14fa78..86cfd458a9cbb619a394a35b4ddc54e30736d9ee 100644
--- a/tools/gn/import_manager.cc
+++ b/tools/gn/import_manager.cc
@@ -30,8 +30,12 @@ std::unique_ptr<Scope> UncachedImport(const Settings* settings,
scope->SetProcessingImport();
node->Execute(scope.get(), err);
- if (err->has_error())
+ if (err->has_error()) {
+ // If there was an error, append the caller location so the error message
+ // displays a why the file was imported (esp. useful for failed asserts).
+ err->AppendSubErr(Err(node_for_err, "whence it was imported."));
return nullptr;
+ }
scope->ClearProcessingImport();
return scope;
« no previous file with comments | « no previous file | tools/gn/loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698