-
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: reinvestigate error handling and reporting in the system #11443
Comments
strong +1 some points
We might need to revisit this to see whether other places have the same problem. I didn't care much about
We might need a developer guide (and/or crate rustdocs) for developers to follow. Even I've read a lot about error handling before, I feel still confused about how to do it. A short and actionable HOWTOs (and some simple explanations) should reduce a lot of confusions. It can be opinionated, but we need some guide.
This is especially confusing. I'm now wondering whether categorization is needed at all.
I recently noticed Some arbitrary refs (for myself to read later) |
BTW, I like this sentence: "Be either actionable or informational" (from smithy-lang/smithy-rs#1950)
P.S., I don't know whether the result of their refactor is good, since it has some learning burden for me. Haven't check its every details yet. AWS SDK is complex beasts though. 🤣 |
I also found this a good practice we can follow. This is also how https://github.com/dtolnay/anyhow/blob/7fc0c073c4c31ef8664f699e9e4883b1c92b2fb6/src/fmt.rs#L7 |
However, not all libraries follows the convention. So eventually we get https://docs.rs/snafu/latest/snafu/struct.CleanedErrorText.html 🤣. |
Tracking the task:
|
This issue has been open for 60 days with no activity. Could you please update the status? Feel free to continue discussion or close as not planned. |
Note
Tracking the tasks in the comment: #11443 (comment)
As more and more features are introduced in our system, it turns out that error handling and reporting become increasingly messy at the same time. We're struggling with several issues, including...
source
chain gets broken when reporting error, so the actual cause for the error is lost. (improve error logging for aws sdk err #10993)Besides, developers also find it annoying to deal with errors...
enum
variants.risingwave/src/frontend/src/binder/expr/function.rs
Lines 421 to 428 in 8d35cb7
RwError
still lives in the frontend and batch executors even though we proposed to clean it up one year ago. (Tracking: Eliminate usages ofRwError
#4077)anyhow
orbail
extensively, resulting in a messy categorization of the majority of errors asinternal error
.Based on this, I propose several guidelines on how we should deal with errors in different modules in RisingWave:
Use
snafu
(orthiserror
) to define errors, if a considerable usage of this error is to construct new errors, and the rest is to propagate errors attaching contexts optionally.library
, likeExprError
,StreamError
, andOptimizerError
.String
everywhere.anyhow
as the fall-back variant of the error for the errors that cannot be easily categorized or can rarely happen.Directly wrap
anyhow::Error
into a new error type, if a considerable usage of this error is to propagate errors from lower-level crates without strong necessity of attaching contexts, and the rest is to construct new errors.application
, likeStreamExecutorError
.The text was updated successfully, but these errors were encountered: