xushiyan commented on code in PR #59:
URL: https://github.com/apache/hudi-rs/pull/59#discussion_r1671383401
##########
crates/core/src/config/mod.rs:
##########
@@ -18,14 +18,33 @@
*/
use std::any::type_name;
use std::collections::HashMap;
+use std::error::Error;
+use std::fmt;
use std::sync::Arc;
-use anyhow::Result;
-
pub mod internal;
pub mod read;
pub mod table;
+#[derive(Debug)]
+pub enum ConfigError {
+ NotFound,
+ ParseError(String),
+ Other(String),
Review 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](https://docs.rs/thiserror/latest/thiserror/) in the next release.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]