diff --git a/src/lib.rs b/src/lib.rs index 150f642b..c263f2ae 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -320,12 +320,19 @@ impl InnerSqliteConnection { SqliteError{ code: r, message: ffi::code_to_str(r).to_string() } } else { + let e = SqliteError::from_handle(db, r); ffi::sqlite3_close(db); - SqliteError::from_handle(db, r) + e }; return Err(e); } + let r = ffi::sqlite3_busy_timeout(db, 5000); + if r != ffi::SQLITE_OK { + let e = SqliteError::from_handle(db, r); + ffi::sqlite3_close(db); + return Err(e); + } Ok(InnerSqliteConnection{ db: db }) }) }