Commit d3acb0c3 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

sqlite: Statement: minor simplification

parent 27c5bab2
......@@ -149,17 +149,14 @@ public:
return Row( m_stmt.get() );
else if ( res == SQLITE_DONE )
return Row();
else
std::string errMsg = sqlite3_errmsg( m_dbConn );
switch ( res )
{
std::string errMsg = sqlite3_errmsg( m_dbConn );
switch ( res )
{
case SQLITE_CONSTRAINT:
throw errors::ConstraintViolation( sqlite3_sql( m_stmt.get() ), errMsg );
default:
throw std::runtime_error( std::string{ sqlite3_sql( m_stmt.get() ) }
+ ": " + errMsg );
}
case SQLITE_CONSTRAINT:
throw errors::ConstraintViolation( sqlite3_sql( m_stmt.get() ), errMsg );
default:
throw std::runtime_error( std::string{ sqlite3_sql( m_stmt.get() ) }
+ ": " + errMsg );
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment