From: Gunnar Beutner Date: Tue, 27 May 2014 13:51:38 +0000 (+0200) Subject: Remove icinga::ErrorInformation. X-Git-Tag: v2.0.0-beta2~72 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e7c09dac97c2783b05cc34a1dd9dc64455a8ecff;p=icinga2 Remove icinga::ErrorInformation. Fixes #6333 --- diff --git a/components/db_ido_mysql/idomysqlconnection.cpp b/components/db_ido_mysql/idomysqlconnection.cpp index b5e4009b9..bc5443a34 100644 --- a/components/db_ido_mysql/idomysqlconnection.cpp +++ b/components/db_ido_mysql/idomysqlconnection.cpp @@ -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); diff --git a/components/db_ido_pgsql/idopgsqlconnection.cpp b/components/db_ido_pgsql/idopgsqlconnection.cpp index d55693f29..fe192c67e 100644 --- a/components/db_ido_pgsql/idopgsqlconnection.cpp +++ b/components/db_ido_pgsql/idopgsqlconnection.cpp @@ -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); diff --git a/lib/base/exception.cpp b/lib/base/exception.cpp index c3da16cef..633c8159a 100644 --- a/lib/base/exception.cpp +++ b/lib/base/exception.cpp @@ -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(); - } -} diff --git a/lib/base/exception.hpp b/lib/base/exception.hpp index 4cd5bf06f..dbbb1906c 100644 --- a/lib/base/exception.hpp +++ b/lib/base/exception.hpp @@ -84,18 +84,7 @@ String DiagnosticInformation(const T& ex, StackTrace *stack = NULL, ContextTrace return result.str(); } -template -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 { };