-
Notifications
You must be signed in to change notification settings - Fork 32
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: enhance error handling with custom ConfigError type #59
base: main
Are you sure you want to change the base?
Conversation
codope
commented
Jul 9, 2024
- Created ConfigError enum for more robust error handling
- Updated ConfigParser trait and its implementations to use ConfigError
- Modified HudiInternalConfig, HudiReadConfig, and HudiTableConfig to leverage ConfigError
- Adjusted tests to align with new error handling
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #59 +/- ##
==========================================
- Coverage 87.19% 87.17% -0.02%
==========================================
Files 13 13
Lines 687 702 +15
==========================================
+ Hits 599 612 +13
- Misses 88 90 +2 ☔ View full report in Codecov by Sentry. |
pub enum ConfigError { | ||
NotFound, | ||
ParseError(String), | ||
Other(String), |
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.
that's a nice improvement. I would suggest capture underlying error as source, like ParseError should capture std::ParseIntError, etc, and NotFound should capture which key (ConfigParser) it refers to.
On a bigger scope, we should definitely standardize error types throughout hudi-core and other hudi crates. I chose anyhow
for fast iteration and uncover error handling paths first. So all errors come out from hudi are now anyhow::Error. I suggest replace anyhow dependency with well-defined custom error enums implemented with thiserror in the next release.