diff rust/hg-core/src/errors.rs @ 52074:de317a87ea6a

rust-pathauditor: match more of Python's behavior and display messages We will make use of the path auditor when running our update fast-path, and we want to output of it to be close enough.
author Rapha?l Gom?s <rgomes@octobus.net>
date Wed, 02 Oct 2024 20:29:48 +0200
parents 491f3dd080eb
children 96b113d22b34 7be39c5110c9
line wrap: on
line diff
--- a/rust/hg-core/src/errors.rs	Wed Oct 02 18:31:32 2024 +0200
+++ b/rust/hg-core/src/errors.rs	Wed Oct 02 20:29:48 2024 +0200
@@ -1,5 +1,6 @@
 use crate::config::ConfigValueParseError;
 use crate::exit_codes;
+use crate::utils::hg_path::HgPathError;
 use std::fmt;
 
 /// Common error cases that can happen in many different APIs
@@ -49,6 +50,8 @@
     /// A race condition has been detected. This *must* be handled locally
     /// and not directly surface to the user.
     RaceDetected(String),
+    /// An invalid path was found
+    Path(HgPathError),
 }
 
 /// Details about where an I/O error happened
@@ -117,6 +120,7 @@
             HgError::RaceDetected(context) => {
                 write!(f, "encountered a race condition {context}")
             }
+            HgError::Path(hg_path_error) => write!(f, "{}", hg_path_error),
         }
     }
 }