Commit c8ada61f authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

sqlite: Enable and log extended error codes

parent 819c513e
......@@ -59,6 +59,7 @@ SqliteConnection::Handle SqliteConnection::getConn()
if ( res != SQLITE_OK )
throw sqlite::errors::Generic( std::string( "Failed to connect to database: " )
+ sqlite3_errstr( res ) );
sqlite3_extended_result_codes( dbConnection, 1 );
sqlite::Statement s( dbConnection, "PRAGMA foreign_keys = ON" );
s.execute();
while ( s.row() != nullptr )
......
......@@ -54,7 +54,8 @@ class GenericExecution : public Generic
{
public:
GenericExecution( const char* req, const char* errMsg, int errCode )
: Generic( std::string( "Failed to run request <" ) + req + ">: " + errMsg )
: Generic( std::string( "Failed to run request <" ) + req + ">: " + errMsg +
"(" + std::to_string( errCode ) + ")" )
, m_errorCode( errCode )
{
}
......
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