Skip to content

Commit 6572db8

Browse files
committedMar 12, 2016
better logging if rollback fails with Exception

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎Data/src/Transaction.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ Transaction::~Transaction()
5151

5252
_rSession.rollback();
5353
}
54+
catch (Poco::Exception& exc)
55+
{
56+
if (_pLogger)
57+
_pLogger->error("Error while rolling back database transaction: %s", exc.displayText());
58+
}
5459
catch (...)
5560
{
5661
if (_pLogger)
@@ -93,7 +98,7 @@ void Transaction::execute(const std::vector<std::string>& sql)
9398
}
9499
catch (Exception& ex)
95100
{
96-
if (_pLogger) _pLogger->error(ex.displayText());
101+
if (_pLogger) _pLogger->log(ex);
97102
}
98103

99104
rollback();

0 commit comments

Comments
 (0)
Please sign in to comment.