mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-17 11:05:03 +02:00
better logging if rollback fails with Exception
This commit is contained in:
@@ -51,6 +51,11 @@ Transaction::~Transaction()
|
||||
|
||||
_rSession.rollback();
|
||||
}
|
||||
catch (Poco::Exception& exc)
|
||||
{
|
||||
if (_pLogger)
|
||||
_pLogger->error("Error while rolling back database transaction: %s", exc.displayText());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
if (_pLogger)
|
||||
@@ -93,7 +98,7 @@ void Transaction::execute(const std::vector<std::string>& sql)
|
||||
}
|
||||
catch (Exception& ex)
|
||||
{
|
||||
if (_pLogger) _pLogger->error(ex.displayText());
|
||||
if (_pLogger) _pLogger->log(ex);
|
||||
}
|
||||
|
||||
rollback();
|
||||
|
Reference in New Issue
Block a user