From 0f4f07d5d3ebc8034e744073d54db328cec837d0 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Thu, 27 Jan 2022 08:25:05 +0000 Subject: [PATCH] Improve error message when transaction is cancelled --- src/dbs/executor.rs | 2 +- src/err/mod.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dbs/executor.rs b/src/dbs/executor.rs index 39963ecc..979d690c 100644 --- a/src/dbs/executor.rs +++ b/src/dbs/executor.rs @@ -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, } } diff --git a/src/err/mod.rs b/src/err/mod.rs index b704dbea..5df8fbd8 100644 --- a/src/err/mod.rs +++ b/src/err/mod.rs @@ -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,