use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(tag = "kind", rename_all = "snake_case")]
pub enum ErrorDetails {
ConstraintViolation {
collection: String,
},
WriteConflict {
collection: String,
document_id: String,
},
DeadlineExceeded,
PrevalidationRejected {
constraint: String,
},
AppendOnlyViolation {
collection: String,
},
BalanceViolation {
collection: String,
},
PeriodLocked {
collection: String,
},
StateTransitionViolation {
collection: String,
},
TransitionCheckViolation {
collection: String,
},
TypeGuardViolation {
collection: String,
},
RetentionViolation {
collection: String,
},
LegalHoldActive {
collection: String,
},
TypeMismatch {
collection: String,
},
Overflow {
collection: String,
},
InsufficientBalance {
collection: String,
},
RateExceeded {
gate: String,
},
CollectionNotFound {
collection: String,
},
DocumentNotFound {
collection: String,
document_id: String,
},
CollectionDraining {
collection: String,
},
CollectionDeactivated {
collection: String,
retention_expires_at_ns: u64,
undrop_hint: String,
},
PlanError,
FanOutExceeded {
shards_touched: u16,
limit: u16,
},
SqlNotEnabled,
AuthorizationDenied {
resource: String,
},
AuthExpired,
SyncConnectionFailed,
SyncDeltaRejected {
compensation: Option<crate::sync::compensation::CompensationHint>,
},
ShapeSubscriptionFailed {
shape_id: String,
},
Storage,
SegmentCorrupted,
ColdStorage,
Wal,
Serialization {
format: String,
},
Codec,
Config,
BadRequest,
NoLeader,
NotLeader {
leader_addr: String,
},
MigrationInProgress,
NodeUnreachable,
Cluster,
MemoryExhausted {
engine: String,
},
Encryption,
Bridge,
Dispatch,
Internal,
}