refactor: enhance error handling with custom ConfigError type#59
refactor: enhance error handling with custom ConfigError type#59codope wants to merge 1 commit intoapache:mainfrom
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.
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.
|
this was covered in #215 |