forked from boostorg/beast
Tidy up some use of Error for throw
This commit is contained in:
1 parent
e5e0f527fe
commit
4394594518
13 files changed
+34
-75
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user