diff --git a/librepomgr/helper.h b/librepomgr/helper.h index 9138735..adad842 100644 --- a/librepomgr/helper.h +++ b/librepomgr/helper.h @@ -50,9 +50,9 @@ inline void convertValue(const std::multimap &multimap if (const char *const value = getLastValue(multimap, key)) { boost::system::error_code error; const auto ip = boost::asio::ip::make_address(value, error); - if (ip.is_unspecified()) { - cerr << Phrases::Error << "Specified IP address \"" << value << "\" for key \"" << key << "\" is invalid" << Phrases::End << " " - << error.message() << endl; + if (error) { + cerr << Phrases::ErrorMessage << "Specified IP address \"" << value << "\" for key \"" << key << "\" is invalid" << Phrases::End + << Phrases::SubError << error.message() << Phrases::End; exit(-1); } result = ip; @@ -69,7 +69,7 @@ template <> inline void convertValue(const std::multimap(value); } catch (const ConversionException &) { - cerr << Phrases::Error << "Specified number \"" << value << "\" for key \"" << key << "\" is invalid." << Phrases::End; + cerr << Phrases::ErrorMessage << "Specified number \"" << value << "\" for key \"" << key << "\" is invalid." << Phrases::End; exit(-1); } } @@ -91,7 +91,7 @@ template <> inline void convertValue(const std::multimap