-
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -25,6 +25,7 @@ use risingwave_pb::meta::update_worker_node_schedulability_request::Schedulabili | |||||
use risingwave_pb::meta::{GetClusterInfoResponse, GetReschedulePlanResponse}; | ||||||
use risingwave_stream::task::FragmentId; | ||||||
use serde_yaml; | ||||||
use thiserror_ext::AsReport; | ||||||
|
||||||
use crate::cmd_impl::meta::ReschedulePayload; | ||||||
use crate::common::CtlContext; | ||||||
|
@@ -119,7 +120,7 @@ pub async fn resize(ctl_ctx: &CtlContext, scale_ctx: ScaleCommandContext) -> any | |||||
} = match meta_client.get_cluster_info().await { | ||||||
Ok(resp) => resp, | ||||||
Err(e) => { | ||||||
fail!("Failed to fetch cluster info: {}", e); | ||||||
fail!("Failed to fetch cluster info: {}", e.as_report()); | ||||||
} | ||||||
}; | ||||||
|
||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. I believe
Suggested change
|
||||||
} | ||||||
}; | ||||||
|
||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||||||
} | ||||||
}; | ||||||
|
||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||||||
} | ||||||
}; | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. // TODO(error-handling): should prefer use error types than strings. |
||
Parse(Box<str>), | ||
|
||
#[error("Invalid parameter {name}: {reason}")] | ||
// TODO: error-handling | ||
InvalidParam { | ||
name: &'static str, | ||
reason: Box<str>, | ||
|
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.