Xuanwo commented on code in PR #174:
URL: https://github.com/apache/iceberg-rust/pull/174#discussion_r1477279054


##########
crates/catalog/hms/src/utils.rs:
##########
@@ -15,13 +15,28 @@
 // specific language governing permissions and limitations
 // under the License.
 
+use anyhow::anyhow;
 use iceberg::{Error, ErrorKind};
+use std::fmt::Debug;
+use std::io;
 
 /// Format a thrift error into iceberg error.
-pub fn from_thrift_error(error: thrift::Error) -> Error {
+pub fn from_thrift_error<T>(error: volo_thrift::error::ResponseError<T>) -> 
Error
+where
+    T: Debug,
+{
     Error::new(
         ErrorKind::Unexpected,
         "operation failed for hitting thrift error".to_string(),
     )
+    .with_source(anyhow!("thrift error: {:?}", error))
+}
+
+/// Format an io error into iceberg error.
+pub fn from_io_error(error: io::Error) -> Error {

Review Comment:
   I'm not sure if moving to core and making it a public API is a good idea. 
What if we address this once we have the same `from_io_error` in core?



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to