From 18e6740ac95f74c5865373f4493f4bd25830940a Mon Sep 17 00:00:00 2001 From: shuiyisong <113876041+shuiyisong@users.noreply.github.com> Date: Mon, 30 Jan 2023 11:12:03 +0800 Subject: [PATCH] chore: add interceptor err in `frontend::error::Error` (#917) * chore: add interceptor boxed err * chore: rename * chore: update err msg Co-authored-by: fys <40801205+Fengys123@users.noreply.github.com> --------- Co-authored-by: fys <40801205+Fengys123@users.noreply.github.com> --- src/frontend/src/error.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/frontend/src/error.rs b/src/frontend/src/error.rs index 9a612bce3e..a71240c540 100644 --- a/src/frontend/src/error.rs +++ b/src/frontend/src/error.rs @@ -398,6 +398,12 @@ pub enum Error { column: String, backtrace: Backtrace, }, + + #[snafu(display("SQL execution intercepted, source: {}", source))] + SqlExecIntercepted { + #[snafu(backtrace)] + source: BoxedError, + }, } pub type Result = std::result::Result; @@ -419,6 +425,7 @@ impl ErrorExt for Error { Error::RuntimeResource { source, .. } => source.status_code(), Error::StartServer { source, .. } => source.status_code(), + Error::SqlExecIntercepted { source, .. } => source.status_code(), Error::ParseSql { source } | Error::AlterExprFromStmt { source } => { source.status_code()