Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
Add better error for execute returned results in sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
Julius de Bruijn authored and Julius de Bruijn committed Jun 3, 2020
1 parent fc508c4 commit 7abc33d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/connector/sqlite/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ use rusqlite::types::FromSqlError;
impl From<rusqlite::Error> for Error {
fn from(e: rusqlite::Error) -> Error {
match e {
rusqlite::Error::ExecuteReturnedResults => {
let mut builder = Error::builder(ErrorKind::QueryError(e.into()));
builder.set_original_message("Execute returned results, which is not allowed in SQLite.");

builder.build()
}

rusqlite::Error::QueryReturnedNoRows => Error::builder(ErrorKind::NotFound).build(),

rusqlite::Error::SqliteFailure(
Expand Down

0 comments on commit 7abc33d

Please sign in to comment.