summaryrefslogtreecommitdiff
path: root/lib/xml_base.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:14 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:14 +0200
commit01eb8253196672c969a39587e90b49321a182428 (patch)
tree4a3b71d7913de519744466c9227fda6461c4f0b5 /lib/xml_base.cpp
parent5.0 (diff)
downloadFreeFileSync-01eb8253196672c969a39587e90b49321a182428.tar.gz
FreeFileSync-01eb8253196672c969a39587e90b49321a182428.tar.bz2
FreeFileSync-01eb8253196672c969a39587e90b49321a182428.zip
5.1
Diffstat (limited to 'lib/xml_base.cpp')
-rw-r--r--lib/xml_base.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/xml_base.cpp b/lib/xml_base.cpp
index e6b1e840..10bb698a 100644
--- a/lib/xml_base.cpp
+++ b/lib/xml_base.cpp
@@ -63,13 +63,17 @@ void xmlAccess::loadXmlDocument(const Zstring& filename, XmlDoc& doc) //throw Ff
const std::wstring xmlAccess::getErrorMessageFormatted(const XmlIn& in)
{
- std::wstring errorMessage = _("Could not read values for the following XML nodes:") + L"\n";
+ std::wstring msg;
- std::vector<std::wstring> failedNodes = in.getErrorsAs<std::wstring>();
- std::for_each(failedNodes.begin(), failedNodes.end(),
- [&](const std::wstring& str) { errorMessage += str + L'\n'; });
+ const auto& failedElements = in.getErrorsAs<std::wstring>();
+ if (!failedElements.empty())
+ {
+ msg = _("Cannot read the following XML elements:") + L"\n";
+ std::for_each(failedElements.begin(), failedElements.end(),
+ [&](const std::wstring& str) { msg += str + L'\n'; });
+ }
- return errorMessage;
+ return msg;
}
bgstack15