if (l_Restarting) {
try {
UpdatePidFile(GetPidPath(), m_ReloadProcess);
- } catch (std::exception&) {
+ } catch (const std::exception&) {
/* abort restart */
Log(LogCritical, "Application", "Cannot update PID file. Aborting restart operation.");
return;
try {
UpdatePidFile(GetPidPath());
- } catch (std::exception&) {
+ } catch (const std::exception&) {
Log(LogCritical, "Application", "Cannot update PID file '" + GetPidPath() + "'. Aborting.");
return false;
}
{
try {
return boost::lexical_cast<long>(val);
- } catch (std::exception&) {
+ } catch (const std::exception&) {
std::ostringstream msgbuf;
msgbuf << "Can't convert '" << val << "' to an integer.";
BOOST_THROW_EXCEPTION(std::invalid_argument(msgbuf.str()));
{
try {
return boost::lexical_cast<double>(val);
- } catch (std::exception&) {
+ } catch (const std::exception&) {
std::ostringstream msgbuf;
msgbuf << "Can't convert '" << val << "' to a floating point number.";
BOOST_THROW_EXCEPTION(std::invalid_argument(msgbuf.str()));
try {
ls = Logger::StringToSeverity(severity);
- } catch (std::exception&) { /* use the default level */ }
+ } catch (const std::exception&) { /* use the default level */ }
return ls;
}
String address;
try {
address = GetAddressFromSockaddr((sockaddr *)&sin, len);
- } catch (std::exception&) {
+ } catch (const std::exception&) {
/* already logged */
}
String address;
try {
address = GetAddressFromSockaddr((sockaddr *)&sin, len);
- } catch (std::exception&) {
+ } catch (const std::exception&) {
/* already logged */
}
try {
stream << Logger::SeverityToString(entry.Severity);
- } catch (std::exception&) {
+ } catch (const std::exception&) {
/* bail early */
return;
}
case SSL_ERROR_WANT_READ:
try {
m_Socket->Poll(true, false);
- } catch (std::exception&) {}
+ } catch (const std::exception&) {}
continue;
case SSL_ERROR_WANT_WRITE:
try {
m_Socket->Poll(false, true);
- } catch (std::exception&) {}
+ } catch (const std::exception&) {}
continue;
case SSL_ERROR_ZERO_RETURN:
Close();
case SSL_ERROR_WANT_READ:
try {
m_Socket->Poll(true, false);
- } catch (std::exception&) {}
+ } catch (const std::exception&) {}
continue;
case SSL_ERROR_WANT_WRITE:
try {
m_Socket->Poll(false, true);
- } catch (std::exception&) {}
+ } catch (const std::exception&) {}
continue;
case SSL_ERROR_ZERO_RETURN:
Close();
case SSL_ERROR_WANT_READ:
try {
m_Socket->Poll(true, false);
- } catch (std::exception&) {}
+ } catch (const std::exception&) {}
continue;
case SSL_ERROR_WANT_WRITE:
try {
m_Socket->Poll(false, true);
- } catch (std::exception&) {}
+ } catch (const std::exception&) {}
continue;
case SSL_ERROR_ZERO_RETURN:
Close();
case SSL_ERROR_WANT_READ:
try {
m_Socket->Poll(true, false);
- } catch (std::exception&) {}
+ } catch (const std::exception&) {}
continue;
case SSL_ERROR_WANT_WRITE:
try {
m_Socket->Poll(false, true);
- } catch (std::exception&) {}
+ } catch (const std::exception&) {}
continue;
default:
goto close_socket;
BOOST_THROW_EXCEPTION(std::invalid_argument("Function '" + method + "' does not exist."));
resultMessage->Set("result", afunc->Invoke(origin, message->Get("params")));
- } catch (std::exception& ex) {
+ } catch (const std::exception& ex) {
resultMessage->Set("error", DiagnosticInformation(ex));
}
try {
SyncZoneDir(zone);
- } catch (std::exception&) {
+ } catch (const std::exception&) {
continue;
}
}
shared_ptr<X509> cert = make_shared<X509>();
try {
cert = GetX509Certificate(GetCertPath());
- } catch (std::exception&) {
+ } catch (const std::exception&) {
Log(LogCritical, "ApiListener", "Cannot get certificate from cert path: '" + GetCertPath() + "'.");
Application::Exit(EXIT_FAILURE);
}
try {
SetIdentity(GetCertificateCN(cert));
- } catch (std::exception&) {
+ } catch (const std::exception&) {
Log(LogCritical, "ApiListener", "Cannot get certificate common name from cert path: '" + GetCertPath() + "'.");
Application::Exit(EXIT_FAILURE);
}
try {
m_SSLContext = MakeSSLContext(GetCertPath(), GetKeyPath(), GetCaPath());
- } catch (std::exception&) {
+ } catch (const std::exception&) {
Log(LogCritical, "ApiListener", "Cannot make SSL context for cert path: '" + GetCertPath() + "' key path: '" + GetKeyPath() + "' ca path: '" + GetCaPath() + "'.");
Application::Exit(EXIT_FAILURE);
}
if (!GetCrlPath().IsEmpty()) {
try {
AddCRLToSSLContext(m_SSLContext, GetCrlPath());
- } catch (std::exception&) {
+ } catch (const std::exception&) {
Log(LogCritical, "ApiListener", "Cannot add certificate revocation list to SSL context for crl path: '" + GetCrlPath() + "'.");
Application::Exit(EXIT_FAILURE);
}
try {
Socket::Ptr client = server->Accept();
Utility::QueueAsyncCallback(boost::bind(&ApiListener::NewClientHandler, this, client, RoleServer));
- } catch (std::exception&) {
+ } catch (const std::exception&) {
Log(LogCritical, "ApiListener", "Cannot accept new connection.");
}
}
ObjectLock olock(this);
try {
tlsStream = make_shared<TlsStream>(client, role, m_SSLContext);
- } catch (std::exception&) {
+ } catch (const std::exception&) {
Log(LogCritical, "ApiListener", "Cannot create tls stream from client connection.");
return;
}
try {
tlsStream->Handshake();
- } catch (std::exception) {
+ } catch (const std::exception&) {
Log(LogCritical, "ApiListener", "Client TLS handshake failed.");
return;
}
try {
identity = GetCertificateCN(cert);
- } catch (std::exception&) {
+ } catch (const std::exception&) {
Log(LogCritical, "ApiListener", "Cannot get certificate common name from cert path: '" + GetCertPath() + "'.");
return;
}