mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-18 14:00:39 +00:00
fix: remove redundant error messages in admin functions (#7953)
Closes #7938 Signed-off-by: yxrxy <yxrxytrigger@gmail.com>
This commit is contained in:
@@ -128,7 +128,7 @@ mod tests {
|
||||
};
|
||||
let result = f.invoke_async_with_args(func_args).await.unwrap_err();
|
||||
assert_eq!(
|
||||
"Execution error: Handler error: Missing TableMutationHandler, not expected",
|
||||
"Execution error: Missing TableMutationHandler, not expected",
|
||||
result.to_string()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -355,7 +355,7 @@ mod tests {
|
||||
};
|
||||
let result = f.invoke_async_with_args(func_args).await.unwrap_err();
|
||||
assert_eq!(
|
||||
"Execution error: Handler error: Missing TableMutationHandler, not expected",
|
||||
"Execution error: Missing TableMutationHandler, not expected",
|
||||
result.to_string()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ mod tests {
|
||||
};
|
||||
let result = f.invoke_async_with_args(func_args).await.unwrap_err();
|
||||
assert_eq!(
|
||||
"Execution error: Handler error: Missing ProcedureServiceHandler, not expected",
|
||||
"Execution error: Missing ProcedureServiceHandler, not expected",
|
||||
result.to_string()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ mod test {
|
||||
|
||||
let result = f.invoke_async_with_args(func_args).await.unwrap_err();
|
||||
assert_eq!(
|
||||
"Execution error: Handler error: Missing FlowServiceHandler, not expected",
|
||||
"Execution error: Missing FlowServiceHandler, not expected",
|
||||
result.to_string()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -316,14 +316,14 @@ fn build_struct(
|
||||
.#handler
|
||||
.as_ref()
|
||||
.context(#snafu_type)
|
||||
.map_err(|e| datafusion_common::DataFusionError::Execution(format!("Handler error: {}", e.output_msg())))?;
|
||||
.map_err(|e| datafusion_common::DataFusionError::Execution(e.output_msg()))?;
|
||||
|
||||
let mut builder = store_api::storage::ConcreteDataType::#ret()
|
||||
.create_mutable_vector(rows_num);
|
||||
|
||||
if columns_num == 0 {
|
||||
let result = #fn_name(handler, query_ctx, &[]).await
|
||||
.map_err(|e| datafusion_common::DataFusionError::Execution(format!("Function execution error: {}", e.output_msg())))?;
|
||||
.map_err(|e| datafusion_common::DataFusionError::Execution(e.output_msg()))?;
|
||||
|
||||
builder.push_value_ref(&result.as_value_ref());
|
||||
} else {
|
||||
@@ -333,7 +333,7 @@ fn build_struct(
|
||||
.collect();
|
||||
|
||||
let result = #fn_name(handler, query_ctx, &args).await
|
||||
.map_err(|e| datafusion_common::DataFusionError::Execution(format!("Function execution error: {}", e.output_msg())))?;
|
||||
.map_err(|e| datafusion_common::DataFusionError::Execution(e.output_msg()))?;
|
||||
|
||||
builder.push_value_ref(&result.as_value_ref());
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ pub enum Error {
|
||||
#[snafu(display("Failed to build admin function args: {msg}"))]
|
||||
BuildAdminFunctionArgs { msg: String },
|
||||
|
||||
#[snafu(display("Failed to execute admin function: {msg}, error: {error}"))]
|
||||
#[snafu(display("Failed to execute admin function {msg}"))]
|
||||
ExecuteAdminFunction {
|
||||
msg: String,
|
||||
#[snafu(source)]
|
||||
|
||||
@@ -133,7 +133,7 @@ impl StatementExecutor {
|
||||
.invoke_async_with_args(func_args)
|
||||
.await
|
||||
.with_context(|_| ExecuteAdminFunctionSnafu {
|
||||
msg: format!("Failed to execute admin function {}", fn_name),
|
||||
msg: fn_name.to_string(),
|
||||
})?;
|
||||
|
||||
// Convert result back to VectorRef
|
||||
|
||||
@@ -185,7 +185,7 @@ Affected Rows: 2
|
||||
-- should return error
|
||||
ADMIN FLUSH_FLOW('find_approx_rate');
|
||||
|
||||
Error: 1002(Unexpected), Failed to execute admin function: Failed to execute admin function flush_flow, error: Execution error: Function execution error: Internal error: 1003: Execution error: Function execution error: Internal error: 1003
|
||||
Error: 1002(Unexpected), Failed to execute admin function flush_flow: Execution error: Internal error: 1003
|
||||
|
||||
DROP FLOW find_approx_rate;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user