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
diff --git a/init/property_service.cpp b/init/property_service.cpp
index 3761750..3819042 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -648,13 +648,14 @@
}
std::string raw_filename(fn);
- std::string expanded_filename;
- if (!expand_props(raw_filename, &expanded_filename)) {
- LOG(ERROR) << "Could not expand filename '" << raw_filename << "'";
+ auto expanded_filename = ExpandProps(raw_filename);
+
+ if (!expanded_filename) {
+ LOG(ERROR) << "Could not expand filename ': " << expanded_filename.error();
continue;
}
- load_properties_from_file(expanded_filename.c_str(), key, properties);
+ load_properties_from_file(expanded_filename->c_str(), key, properties);
} else {
value = strchr(key, '=');
if (!value) continue;