rok commented on code in PR #6637: URL: https://github.com/apache/arrow-rs/pull/6637#discussion_r1987345496
########## parquet/src/errors.rs: ########## @@ -132,6 +132,13 @@ impl From<object_store::Error> for ParquetError { } } +#[cfg(feature = "encryption")] +impl From<ring::error::Unspecified> for ParquetError { + fn from(e: ring::error::Unspecified) -> ParquetError { + ParquetError::External(Box::new(e)) Review Comment: Perhaps a follow-up would be better yeah. I imagine it'd be something like this: ```diff git diff parquet/src/errors.rs diff --git i/parquet/src/errors.rs w/parquet/src/errors.rs index 4cb1f99c3..257c6abf5 100644 --- i/parquet/src/errors.rs +++ w/parquet/src/errors.rs @@ -52,6 +52,10 @@ pub enum ParquetError { /// Returned when a function needs more data to complete properly. The `usize` field indicates /// the total number of bytes required, not the number of additional bytes. NeedMoreData(usize), + #[cfg(feature = "encryption")] + /// Encryption error. + /// Returned when encryption or decryption fails. + EncryptionError(Box<dyn Error + Send + Sync>), } impl std::fmt::Display for ParquetError { @@ -69,6 +73,8 @@ impl std::fmt::Display for ParquetError { } ParquetError::External(e) => write!(fmt, "External: {e}"), ParquetError::NeedMoreData(needed) => write!(fmt, "NeedMoreData: {needed}"), + #[cfg(feature = "encryption")] + ParquetError::EncryptionError(e) => write!(fmt, "EncryptionError: {e}"), } } } @@ -135,7 +141,7 @@ impl From<object_store::Error> for ParquetError { #[cfg(feature = "encryption")] impl From<ring::error::Unspecified> for ParquetError { fn from(e: ring::error::Unspecified) -> ParquetError { - ParquetError::External(Box::new(e)) + ParquetError::EncryptionError(Box::new(e)) } } ``` -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org