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

sqlite: Connection: Don't swallow the actual error when failing to connect

parent 944da910
......@@ -57,7 +57,8 @@ SqliteConnection::Handle SqliteConnection::getConn()
auto res = sqlite3_open( m_dbPath.c_str(), &dbConnection );
ConnPtr dbConn( dbConnection, &sqlite3_close );
if ( res != SQLITE_OK )
throw std::runtime_error( "Failed to connect to database" );
throw sqlite::errors::Generic( std::string( "Failed to connect to database: " )
+ sqlite3_errstr( res ) );
sqlite::Statement s( dbConnection, "PRAGMA foreign_keys = ON" );
s.execute();
while ( s.row() != nullptr )
......
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