mirror of https://github.com/Icinga/icinga2.git
parent
ecb4f9738e
commit
e7c09dac97
|
@ -94,8 +94,7 @@ void IdoMysqlConnection::Pause(void)
|
|||
|
||||
void IdoMysqlConnection::ExceptionHandler(boost::exception_ptr exp)
|
||||
{
|
||||
Log(LogCritical, "db_ido_mysql", "Exception during database operation: '" + ErrorInformation(exp) + "'");
|
||||
Log(LogDebug, "db_ido_mysql", "Exception during database operation: " + DiagnosticInformation(exp));
|
||||
Log(LogWarning, "db_ido_mysql", "Exception during database operation: " + DiagnosticInformation(exp));
|
||||
|
||||
boost::mutex::scoped_lock lock(m_ConnectionMutex);
|
||||
|
||||
|
|
|
@ -96,8 +96,7 @@ void IdoPgsqlConnection::Pause(void)
|
|||
|
||||
void IdoPgsqlConnection::ExceptionHandler(boost::exception_ptr exp)
|
||||
{
|
||||
Log(LogCritical, "db_ido_pgsql", "Exception during database operation: '" + ErrorInformation(exp) + "'");
|
||||
Log(LogDebug, "db_ido_pgsql", "Exception during database operation: " + DiagnosticInformation(exp));
|
||||
Log(LogWarning, "db_ido_pgsql", "Exception during database operation: " + DiagnosticInformation(exp));
|
||||
|
||||
boost::mutex::scoped_lock lock(m_ConnectionMutex);
|
||||
|
||||
|
|
|
@ -153,11 +153,3 @@ String icinga::DiagnosticInformation(boost::exception_ptr eptr)
|
|||
return boost::diagnostic_information(eptr);
|
||||
}
|
||||
|
||||
String icinga::ErrorInformation(boost::exception_ptr eptr)
|
||||
{
|
||||
try {
|
||||
boost::rethrow_exception(eptr);
|
||||
} catch (const std::exception& ex) {
|
||||
return ex.what();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,18 +84,7 @@ String DiagnosticInformation(const T& ex, StackTrace *stack = NULL, ContextTrace
|
|||
return result.str();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
String ErrorInformation(const T& ex)
|
||||
{
|
||||
std::ostringstream result;
|
||||
|
||||
result << ex.what();
|
||||
|
||||
return result.str();
|
||||
}
|
||||
|
||||
I2_BASE_API String DiagnosticInformation(boost::exception_ptr eptr);
|
||||
I2_BASE_API String ErrorInformation(boost::exception_ptr eptr);
|
||||
|
||||
class I2_BASE_API posix_error : virtual public std::exception, virtual public boost::exception { };
|
||||
|
||||
|
|
Loading…
Reference in New Issue