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>
This commit is contained in:
shuiyisong
2023-01-30 11:12:03 +08:00
committed by GitHub
parent a7dc86ffe5
commit 18e6740ac9

View File

@@ -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<T> = std::result::Result<T, Error>;
@@ -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()