mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-12-01 10:40:14 +08:00
Return typed conflicts for async Draft edits. Release the lock and edit permit before converting the error, and exercise overlapping updates.
13 lines
552 B
Rust
13 lines
552 B
Rust
/// Committed data changed before an asynchronous edit could publish.
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]
|
|
#[error("Optimistic lock failed: Committed data has changed during async operation")]
|
|
pub struct DraftConflict;
|
|
|
|
/// Another transaction is already staging a change to one of the layers asked for.
|
|
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
|
|
#[error("configuration layer {layer} is being changed elsewhere")]
|
|
pub struct DraftBusy {
|
|
/// The layer that was already claimed.
|
|
pub layer: &'static str,
|
|
}
|