mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-26 01:40:36 +00:00
build(deps): bump snafu to 0.8 (#3911)
* change Cargo.toml Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * global replace Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * handle alias in script engine Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix clippy Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -24,14 +24,22 @@ use snafu::{Location, Snafu};
|
||||
#[stack_trace_debug]
|
||||
pub enum Error {
|
||||
#[snafu(display("Failed to find column in scripts table, name: {}", name))]
|
||||
FindColumnInScriptsTable { name: String, location: Location },
|
||||
FindColumnInScriptsTable {
|
||||
name: String,
|
||||
#[snafu(implicit)]
|
||||
location: Location,
|
||||
},
|
||||
|
||||
#[snafu(display("Scripts table not found"))]
|
||||
ScriptsTableNotFound { location: Location },
|
||||
ScriptsTableNotFound {
|
||||
#[snafu(implicit)]
|
||||
location: Location,
|
||||
},
|
||||
|
||||
#[snafu(display("Failed to insert script to scripts table, name: {}", name))]
|
||||
InsertScript {
|
||||
name: String,
|
||||
#[snafu(implicit)]
|
||||
location: Location,
|
||||
source: BoxedError,
|
||||
},
|
||||
@@ -39,6 +47,7 @@ pub enum Error {
|
||||
#[snafu(display("Failed to compile python script, name: {}", name))]
|
||||
CompilePython {
|
||||
name: String,
|
||||
#[snafu(implicit)]
|
||||
location: Location,
|
||||
source: crate::python::error::Error,
|
||||
},
|
||||
@@ -46,32 +55,44 @@ pub enum Error {
|
||||
#[snafu(display("Failed to execute python script {}", name))]
|
||||
ExecutePython {
|
||||
name: String,
|
||||
#[snafu(implicit)]
|
||||
location: Location,
|
||||
source: crate::python::error::Error,
|
||||
},
|
||||
|
||||
#[snafu(display("Script not found, name: {}", name))]
|
||||
ScriptNotFound { location: Location, name: String },
|
||||
ScriptNotFound {
|
||||
#[snafu(implicit)]
|
||||
location: Location,
|
||||
name: String,
|
||||
},
|
||||
|
||||
#[snafu(display("Failed to collect record batch"))]
|
||||
CollectRecords {
|
||||
#[snafu(implicit)]
|
||||
location: Location,
|
||||
source: common_recordbatch::error::Error,
|
||||
},
|
||||
|
||||
#[snafu(display("Failed to cast type, msg: {}", msg))]
|
||||
CastType { msg: String, location: Location },
|
||||
CastType {
|
||||
msg: String,
|
||||
#[snafu(implicit)]
|
||||
location: Location,
|
||||
},
|
||||
|
||||
#[snafu(display("Failed to build DataFusion logical plan"))]
|
||||
BuildDfLogicalPlan {
|
||||
#[snafu(source)]
|
||||
error: datafusion_common::DataFusionError,
|
||||
#[snafu(implicit)]
|
||||
location: Location,
|
||||
},
|
||||
|
||||
#[snafu(display("Failed to execute internal statement"))]
|
||||
ExecuteInternalStatement {
|
||||
source: query::error::Error,
|
||||
#[snafu(implicit)]
|
||||
location: Location,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -38,18 +38,21 @@ pub(crate) fn ret_other_error_with(reason: String) -> OtherSnafu<String> {
|
||||
pub enum Error {
|
||||
#[snafu(display("Datatype error"))]
|
||||
TypeCast {
|
||||
#[snafu(implicit)]
|
||||
location: SnafuLocation,
|
||||
source: DataTypeError,
|
||||
},
|
||||
|
||||
#[snafu(display("Failed to query"))]
|
||||
DatabaseQuery {
|
||||
#[snafu(implicit)]
|
||||
location: SnafuLocation,
|
||||
source: QueryError,
|
||||
},
|
||||
|
||||
#[snafu(display("Failed to parse script"))]
|
||||
PyParse {
|
||||
#[snafu(implicit)]
|
||||
location: SnafuLocation,
|
||||
#[snafu(source)]
|
||||
error: ParseError,
|
||||
@@ -57,6 +60,7 @@ pub enum Error {
|
||||
|
||||
#[snafu(display("Failed to compile script"))]
|
||||
PyCompile {
|
||||
#[snafu(implicit)]
|
||||
location: SnafuLocation,
|
||||
#[snafu(source)]
|
||||
error: CodegenError,
|
||||
@@ -66,11 +70,13 @@ pub enum Error {
|
||||
#[snafu(display("Python Runtime error, error: {}", msg))]
|
||||
PyRuntime {
|
||||
msg: String,
|
||||
#[snafu(implicit)]
|
||||
location: SnafuLocation,
|
||||
},
|
||||
|
||||
#[snafu(display("Arrow error"))]
|
||||
Arrow {
|
||||
#[snafu(implicit)]
|
||||
location: SnafuLocation,
|
||||
#[snafu(source)]
|
||||
error: ArrowError,
|
||||
@@ -78,6 +84,7 @@ pub enum Error {
|
||||
|
||||
#[snafu(display("DataFusion error"))]
|
||||
DataFusion {
|
||||
#[snafu(implicit)]
|
||||
location: SnafuLocation,
|
||||
#[snafu(source)]
|
||||
error: DataFusionError,
|
||||
@@ -91,6 +98,7 @@ pub enum Error {
|
||||
"".into()
|
||||
}))]
|
||||
CoprParse {
|
||||
#[snafu(implicit)]
|
||||
location: SnafuLocation,
|
||||
reason: String,
|
||||
// location is option because maybe errors can't give a clear location?
|
||||
@@ -100,6 +108,7 @@ pub enum Error {
|
||||
/// Other types of error that isn't any of above
|
||||
#[snafu(display("Coprocessor's Internal error: {}", reason))]
|
||||
Other {
|
||||
#[snafu(implicit)]
|
||||
location: SnafuLocation,
|
||||
reason: String,
|
||||
},
|
||||
@@ -107,17 +116,20 @@ pub enum Error {
|
||||
#[snafu(display("Unsupported sql in coprocessor: {}", sql))]
|
||||
UnsupportedSql {
|
||||
sql: String,
|
||||
#[snafu(implicit)]
|
||||
location: SnafuLocation,
|
||||
},
|
||||
|
||||
#[snafu(display("Failed to retrieve record batches"))]
|
||||
RecordBatch {
|
||||
#[snafu(implicit)]
|
||||
location: SnafuLocation,
|
||||
source: common_recordbatch::error::Error,
|
||||
},
|
||||
|
||||
#[snafu(display("Failed to create record batch"))]
|
||||
NewRecordBatch {
|
||||
#[snafu(implicit)]
|
||||
location: SnafuLocation,
|
||||
source: common_recordbatch::error::Error,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user