diff --git a/crates/catalog/rest/src/catalog.rs b/crates/catalog/rest/src/catalog.rs index 3438cb29e1..4b5b489640 100644 --- a/crates/catalog/rest/src/catalog.rs +++ b/crates/catalog/rest/src/catalog.rs @@ -768,8 +768,8 @@ impl Catalog for RestCatalog { } StatusCode::CONFLICT => { return Err(Error::new( - ErrorKind::Unexpected, - "CommitFailedException, one or more requirements failed. The client may retry.", + ErrorKind::CatalogCommitConflicts, + "CatalogCommitConflicts, one or more requirements failed. The client may retry.", ) .with_retryable(true)); } diff --git a/crates/iceberg/src/error.rs b/crates/iceberg/src/error.rs index e69de38575..9f299fb6a9 100644 --- a/crates/iceberg/src/error.rs +++ b/crates/iceberg/src/error.rs @@ -60,6 +60,9 @@ pub enum ErrorKind { /// /// This error is returned when given iceberg feature is not supported. FeatureUnsupported, + + /// Catalog commit failed due to outdated metadata + CatalogCommitConflicts, } impl ErrorKind { @@ -80,6 +83,7 @@ impl From for &'static str { ErrorKind::NamespaceAlreadyExists => "NamespaceAlreadyExists", ErrorKind::NamespaceNotFound => "NamespaceNotFound", ErrorKind::PreconditionFailed => "PreconditionFailed", + ErrorKind::CatalogCommitConflicts => "CatalogCommitConflicts", } } }