diff options
author | Tom Cherry <tomcherry@google.com> | 2019-07-31 13:59:15 -0700 |
---|---|---|
committer | Tom Cherry <tomcherry@google.com> | 2019-08-01 10:34:58 -0700 |
commit | c5cf85db23ac8c8a0206e911d73ef1c42ad66ed6 (patch) | |
tree | 5e940c776939c3d175bf50cbbd1ea92d5840d39a /init/import_parser.cpp | |
parent | 244d9b8fb968b9f0289ac69d723a4f760d1c1b91 (diff) |
init: don't log in expand_props directly
It's better to pass the error message to the caller to determine how
best to print the error.
Test: build
Change-Id: Id8857c459df2f26c031650166609608d20e4d051
Diffstat (limited to 'init/import_parser.cpp')
-rw-r--r-- | init/import_parser.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/init/import_parser.cpp b/init/import_parser.cpp index c72b7d65e..1a43508d7 100644 --- a/init/import_parser.cpp +++ b/init/import_parser.cpp @@ -29,15 +29,14 @@ Result<void> ImportParser::ParseSection(std::vector<std::string>&& args, return Error() << "single argument needed for import\n"; } - std::string conf_file; - bool ret = expand_props(args[1], &conf_file); - if (!ret) { - return Error() << "error while expanding import"; + auto conf_file = ExpandProps(args[1]); + if (!conf_file) { + return Error() << "Could not expand import: " << conf_file.error(); } - LOG(INFO) << "Added '" << conf_file << "' to import list"; + LOG(INFO) << "Added '" << *conf_file << "' to import list"; if (filename_.empty()) filename_ = filename; - imports_.emplace_back(std::move(conf_file), line); + imports_.emplace_back(std::move(*conf_file), line); return {}; } |