Improve error message when transaction is cancelled

This commit is contained in:
Tobie Morgan Hitchcock 2022-01-27 08:25:05 +00:00
parent ff5a5fd346
commit 0f4f07d5d3
2 changed files with 4 additions and 1 deletions

View file

@ -112,7 +112,7 @@ impl<'a> Executor<'a> {
sql: v.sql,
time: v.time,
status: Status::Err,
detail: Some(format!("Transaction cancelled")),
detail: Some(format!("{}", Error::QueryCancelledError)),
result: None,
}
}

View file

@ -70,6 +70,9 @@ pub enum Error {
timer: Duration,
},
#[error("Query not executed due to cancelled transaction")]
QueryCancelledError,
#[error("Query not executed due to failed transaction")]
QueryExecutionError,