Tidy up some use of Error for throw

This commit is contained in:
Vinnie Falco
2013-09-28 18:15:00 -07:00
parent e5e0f527fe
commit 4394594518
13 changed files with 34 additions and 75 deletions

View File

@@ -77,8 +77,7 @@ Error transaction::commit()
Error error;
// already handled
if (m_bHandled)
Throw(Error().fail(__FILE__, __LINE__));
check_precondition (!m_bHandled);
// if commit() throws, m_bHandled will remain false
// and the destructor will attempt a rollback.
@@ -93,8 +92,7 @@ Error transaction::commit()
void transaction::rollback()
{
// already handled
if (m_bHandled)
Throw(Error().fail(__FILE__, __LINE__));
check_precondition (!m_bHandled);
m_session.rollback();
m_bHandled = true;