diff options
author | Yifan Hong | 2018-01-08 18:19:42 -0600 |
---|---|---|
committer | Yifan Hong | 2018-01-09 12:53:04 -0600 |
commit | 60217032e7528245a64ec632b8bd6cc0653a4232 (patch) | |
tree | d4b43976f62d6ca09cdfb4381016a0a145c65340 /check_vintf.cpp | |
parent | 7219ba194890e2d7f579a64f7a1537ea70deae1a (diff) | |
download | platform-system-libvintf-60217032e7528245a64ec632b8bd6cc0653a4232.tar.gz platform-system-libvintf-60217032e7528245a64ec632b8bd6cc0653a4232.tar.xz platform-system-libvintf-60217032e7528245a64ec632b8bd6cc0653a4232.zip |
VintfObject::Get*: move logging logic
... from fetchAllInformation to Get() functions, because logging
logic in headers may cause problems.
Test: manual
Bug: 71504062
Change-Id: I99d6e2728b24b4e40959a6cece71bd9b4625711f
Diffstat (limited to 'check_vintf.cpp')
-rw-r--r-- | check_vintf.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/check_vintf.cpp b/check_vintf.cpp index 211702e..67ecd4e 100644 --- a/check_vintf.cpp +++ b/check_vintf.cpp | |||
@@ -25,9 +25,11 @@ namespace vintf { | |||
25 | template <typename T> | 25 | template <typename T> |
26 | std::unique_ptr<T> readObject(const std::string& path, const XmlConverter<T>& converter) { | 26 | std::unique_ptr<T> readObject(const std::string& path, const XmlConverter<T>& converter) { |
27 | std::string xml; | 27 | std::string xml; |
28 | status_t err = details::gFetcher->fetch(path, xml); | 28 | std::string error; |
29 | status_t err = details::gFetcher->fetch(path, xml, &error); | ||
29 | if (err != OK) { | 30 | if (err != OK) { |
30 | std::cerr << "Error: Cannot read '" << path << "': " << strerror(-err) << std::endl; | 31 | std::cerr << "Error: Cannot read '" << path << "' (" << strerror(-err) << "): " << error |
32 | << std::endl; | ||
31 | return nullptr; | 33 | return nullptr; |
32 | } | 34 | } |
33 | auto ret = std::make_unique<T>(); | 35 | auto ret = std::make_unique<T>(); |