improved error messages for bad addresses.
This commit is contained in:
parent
f129841b38
commit
4688c99ee4
|
@ -406,9 +406,9 @@ parse(int argc, const char** argv)
|
||||||
try {
|
try {
|
||||||
s_serverAddress = CNetworkAddress(argv[i], kDefaultPort);
|
s_serverAddress = CNetworkAddress(argv[i], kDefaultPort);
|
||||||
}
|
}
|
||||||
catch (XSocketAddress&) {
|
catch (XSocketAddress& e) {
|
||||||
log((CLOG_PRINT "%s: invalid server address" BYE,
|
log((CLOG_PRINT "%s: %s" BYE,
|
||||||
pname, pname));
|
pname, e.what(), pname));
|
||||||
bye(kExitArgs);
|
bye(kExitArgs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ XSocketAddress::getWhat() const throw()
|
||||||
"unknown error for: %{1}:%{2}",
|
"unknown error for: %{1}:%{2}",
|
||||||
"address not found for: %{1}",
|
"address not found for: %{1}",
|
||||||
"no address for: %{1}",
|
"no address for: %{1}",
|
||||||
"invalid port: %{2}"
|
"invalid port" // m_port may not be set to the bad port
|
||||||
};
|
};
|
||||||
return format(s_errorID[m_error], s_errorMsg[m_error],
|
return format(s_errorID[m_error], s_errorMsg[m_error],
|
||||||
m_hostname.c_str(),
|
m_hostname.c_str(),
|
||||||
|
|
|
@ -337,8 +337,8 @@ parse(int argc, const char** argv)
|
||||||
s_synergyAddress = CNetworkAddress(argv[i + 1], kDefaultPort);
|
s_synergyAddress = CNetworkAddress(argv[i + 1], kDefaultPort);
|
||||||
}
|
}
|
||||||
catch (XSocketAddress& e) {
|
catch (XSocketAddress& e) {
|
||||||
log((CLOG_PRINT "%s: invalid address for `%s'. %s." BYE,
|
log((CLOG_PRINT "%s: %s" BYE,
|
||||||
pname, argv[i], e.what(), pname));
|
pname, e.what(), pname));
|
||||||
bye(kExitArgs);
|
bye(kExitArgs);
|
||||||
}
|
}
|
||||||
++i;
|
++i;
|
||||||
|
@ -350,8 +350,8 @@ parse(int argc, const char** argv)
|
||||||
s_httpAddress = CNetworkAddress(argv[i + 1], kDefaultPort + 1);
|
s_httpAddress = CNetworkAddress(argv[i + 1], kDefaultPort + 1);
|
||||||
}
|
}
|
||||||
catch (XSocketAddress& e) {
|
catch (XSocketAddress& e) {
|
||||||
log((CLOG_PRINT "%s: invalid address for `%s'. %s." BYE,
|
log((CLOG_PRINT "%s: %s" BYE,
|
||||||
pname, argv[i], e.what(), pname));
|
pname, e.what(), pname));
|
||||||
bye(kExitArgs);
|
bye(kExitArgs);
|
||||||
}
|
}
|
||||||
++i;
|
++i;
|
||||||
|
|
Loading…
Reference in New Issue