Skip to content

Commit

Permalink
step should not panic when SQLITE_BUSY encountered
Browse files Browse the repository at this point in the history
this commit only logs the error, but can more refine grained
method should be used.

reference: https://github.com/jgallagher/rusqlite/blob/master/src/row.rs#L43
  • Loading branch information
king6cong committed Jun 2, 2017
1 parent a6339a0 commit fba14ac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions diesel/src/sqlite/connection/stmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ impl Statement {
match unsafe { ffi::sqlite3_step(self.inner_statement) } {
ffi::SQLITE_DONE => None,
ffi::SQLITE_ROW => Some(SqliteRow::new(self.inner_statement)),
ffi::SQLITE_BUSY => {
error!("SQLITE_BUSY encountered");
None
},
error => panic!("{}", super::error_message(error)),
}
}
Expand Down

0 comments on commit fba14ac

Please sign in to comment.