Skip to content

Commit 46b38bb

Browse files
authored
feat(catalog): Add ErrorKind::CatalogCommitConflicts (#1452)
1 parent 4f1289a commit 46b38bb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

crates/catalog/rest/src/catalog.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,8 +768,8 @@ impl Catalog for RestCatalog {
768768
}
769769
StatusCode::CONFLICT => {
770770
return Err(Error::new(
771-
ErrorKind::Unexpected,
772-
"CommitFailedException, one or more requirements failed. The client may retry.",
771+
ErrorKind::CatalogCommitConflicts,
772+
"CatalogCommitConflicts, one or more requirements failed. The client may retry.",
773773
)
774774
.with_retryable(true));
775775
}

crates/iceberg/src/error.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ pub enum ErrorKind {
6060
///
6161
/// This error is returned when given iceberg feature is not supported.
6262
FeatureUnsupported,
63+
64+
/// Catalog commit failed due to outdated metadata
65+
CatalogCommitConflicts,
6366
}
6467

6568
impl ErrorKind {
@@ -80,6 +83,7 @@ impl From<ErrorKind> for &'static str {
8083
ErrorKind::NamespaceAlreadyExists => "NamespaceAlreadyExists",
8184
ErrorKind::NamespaceNotFound => "NamespaceNotFound",
8285
ErrorKind::PreconditionFailed => "PreconditionFailed",
86+
ErrorKind::CatalogCommitConflicts => "CatalogCommitConflicts",
8387
}
8488
}
8589
}

0 commit comments

Comments
 (0)