rust/hg-core/src/errors.rs
branchstable
changeset 50239 491f3dd080eb
parent 49487 9f14126cfc4c
--- a/rust/hg-core/src/errors.rs	Tue Feb 28 23:35:52 2023 +0100
+++ b/rust/hg-core/src/errors.rs	Tue Feb 28 19:36:46 2023 +0100
@@ -46,6 +46,9 @@
 
     /// Censored revision data.
     CensoredNodeError,
+    /// A race condition has been detected. This *must* be handled locally
+    /// and not directly surface to the user.
+    RaceDetected(String),
 }
 
 /// Details about where an I/O error happened
@@ -111,6 +114,9 @@
                 write!(f, "encountered a censored node")
             }
             HgError::ConfigValueParseError(error) => error.fmt(f),
+            HgError::RaceDetected(context) => {
+                write!(f, "encountered a race condition {context}")
+            }
         }
     }
 }