configuration: Fix confusing error message
It didn't actually say that the problem was the path not existing, and
it's warning about an internally-added extra_import_paths entry which is
even more confusing.
Change-Id: Ice2779c92a85fa294bfdd608e42fcfbeb04efa24
Signed-off-by: Brian Silverman <bsilver16384@gmail.com>
diff --git a/aos/configuration.cc b/aos/configuration.cc
index d05cba8..db00ce7 100644
--- a/aos/configuration.cc
+++ b/aos/configuration.cc
@@ -181,11 +181,11 @@
// instead. It is much faster to load .bfbs files than .json files.
if (!binary_path_exists && !util::PathExists(raw_path)) {
const bool path_is_absolute = raw_path.size() > 0 && raw_path[0] == '/';
- if (path_is_absolute && !extra_import_paths.empty()) {
- LOG(ERROR)
- << "Can't specify extra import paths if attempting to read a config "
- "file from an absolute path (path is "
- << raw_path << ").";
+ if (path_is_absolute) {
+ // Nowhere else to look up an absolute path, so fail now. Note that we
+ // always have at least one extra import path based on /proc/self/exe, so
+ // warning about those paths existing isn't helpful.
+ LOG(ERROR) << ": Failed to find file " << path << ".";
return std::nullopt;
}