Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/iceberg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ serde_derive = "^1.0"
serde_json = "^1.0"
serde_repr = "0.1.16"
url = "2"
uuid = "1.4.1"
uuid = { version = "1.4.1", features = ["v4"] }

[dev-dependencies]
pretty_assertions = "1.4.0"
Expand Down
10 changes: 10 additions & 0 deletions crates/iceberg/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ use std::fmt::Debug;
use std::fmt::Display;
use std::fmt::Formatter;

use derive_builder::UninitializedFieldError;

/// Result that is a wrapper of `Result<T, iceberg::Error>`
pub type Result<T> = std::result::Result<T, Error>;

Expand Down Expand Up @@ -192,6 +194,14 @@ impl std::error::Error for Error {
}
}

// We define a from implementation from builder Error to Iceberg Error
impl From<UninitializedFieldError> for Error {
fn from(ufe: UninitializedFieldError) -> Error {
Error::new(ErrorKind::DataInvalid, "Some fields of table metadata not inited")
.with_source(ufe)
}
}

impl Error {
/// Create a new Error with error kind and message.
pub fn new(kind: ErrorKind, message: impl Into<String>) -> Self {
Expand Down
Loading