-
Notifications
You must be signed in to change notification settings - Fork 615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(error): clean-up direct error formatting (part 2) #13870
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #13870 +/- ##
==========================================
- Coverage 68.29% 68.26% -0.03%
==========================================
Files 1525 1525
Lines 262324 262329 +5
==========================================
- Hits 179143 179088 -55
- Misses 83181 83241 +60
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM. Good work!
src/connector/src/lib.rs
Outdated
@@ -32,6 +32,9 @@ | |||
#![feature(iterator_try_collect)] | |||
#![feature(try_blocks)] | |||
#![feature(error_generic_member_access)] | |||
#![feature(register_tool)] | |||
#![register_tool(rw)] | |||
#![allow(rw::format_error)] // TODO: remove this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#![allow(rw::format_error)] // TODO: remove this | |
#![allow(rw::format_error)] // TODO(error-handling): need further refactoring |
src/ctl/src/cmd_impl/scale/resize.rs
Outdated
@@ -300,7 +301,7 @@ pub async fn resize(ctl_ctx: &CtlContext, scale_ctx: ScaleCommandContext) -> any | |||
} = match response { | |||
Ok(response) => response, | |||
Err(e) => { | |||
fail!("Failed to generate plan: {:?}", e); | |||
fail!("Failed to generate plan: {:?}", e.as_report()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe Display
(without backtrace) is enough. Backtraces on the client side does not make sense.
fail!("Failed to generate plan: {:?}", e.as_report()); | |
fail!("Failed to generate plan: {}", e.as_report()); |
src/ctl/src/cmd_impl/scale/resize.rs
Outdated
@@ -364,7 +365,7 @@ pub async fn resize(ctl_ctx: &CtlContext, scale_ctx: ScaleCommandContext) -> any | |||
match meta_client.reschedule(reschedules, revision, false).await { | |||
Ok(response) => response, | |||
Err(e) => { | |||
fail!("Failed to execute plan: {:?}", e); | |||
fail!("Failed to execute plan: {:?}", e.as_report()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
src/ctl/src/cmd_impl/scale/resize.rs
Outdated
@@ -391,7 +392,7 @@ pub async fn update_schedulability( | |||
let GetClusterInfoResponse { worker_nodes, .. } = match meta_client.get_cluster_info().await { | |||
Ok(resp) => resp, | |||
Err(e) => { | |||
fail!("Failed to get cluster info: {:?}", e); | |||
fail!("Failed to get cluster info: {:?}", e.as_report()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
src/expr/core/src/error.rs
Outdated
@@ -63,9 +63,11 @@ pub enum ExprError { | |||
DivisionByZero, | |||
|
|||
#[error("Parse error: {0}")] | |||
// TODO: error-handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO(error-handling): should prefer use error types than strings.
@@ -156,7 +157,9 @@ impl StreamFragmentGraph { | |||
.map_err(|e| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.map_err(|e| { | |
.with_context(|| format!("edge .. exists"))?; |
src/jni_core/src/jvm_runtime.rs
Outdated
.map_err(|e| format!("unable to get path of current_exe: {:?}", e))? | ||
.map_err(|e| format!("unable to get path of current_exe: {:?}", e.as_report()))? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest returning anyhow::Result
for this function and using context
.
src/jni_core/src/jvm_runtime.rs
Outdated
.map_err(|e| format!("invalid jvm args: {:?}", e))?; | ||
.map_err(|e| format!("invalid jvm args: {:?}", e.as_report()))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
src/jni_core/src/jvm_runtime.rs
Outdated
@@ -128,7 +129,7 @@ impl JavaVmWrapper { | |||
tracing::info!("initialize JVM successfully"); | |||
|
|||
register_native_method_for_jvm(&jvm) | |||
.map_err(|e| format!("failed to register native method: {:?}", e))?; | |||
.map_err(|e| format!("failed to register native method: {:?}", e.as_report()))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
src/udf/src/error.rs
Outdated
@@ -39,6 +39,7 @@ pub enum ErrorInner { | |||
Arrow(#[from] arrow_schema::ArrowError), | |||
|
|||
#[error("UDF unsupported: {0}")] | |||
// TODO: error-handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO: error-handling | |
// TODO(error-handling): should prefer use error types than strings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
follow up #13763
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.