Mercurial > public > mercurial-scm > hg-stable
comparison rust/hg-core/src/errors.rs @ 52313:65d516db7309
branching: merge stable into default
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Thu, 14 Nov 2024 16:45:23 +0100 |
parents | 7be39c5110c9 96b113d22b34 |
children | 09a36de53b60 |
comparison
equal
deleted
inserted
replaced
52312:85bff84f0ad5 | 52313:65d516db7309 |
---|---|
50 /// A race condition has been detected. This *must* be handled locally | 50 /// A race condition has been detected. This *must* be handled locally |
51 /// and not directly surface to the user. | 51 /// and not directly surface to the user. |
52 RaceDetected(String), | 52 RaceDetected(String), |
53 /// An invalid path was found | 53 /// An invalid path was found |
54 Path(HgPathError), | 54 Path(HgPathError), |
55 /// An interrupt was received and we need to stop whatever we're doing | |
56 InterruptReceived, | |
55 } | 57 } |
56 | 58 |
57 /// Details about where an I/O error happened | 59 /// Details about where an I/O error happened |
58 #[derive(Debug)] | 60 #[derive(Debug)] |
59 pub enum IoErrorContext { | 61 pub enum IoErrorContext { |
123 HgError::ConfigValueParseError(error) => error.fmt(f), | 125 HgError::ConfigValueParseError(error) => error.fmt(f), |
124 HgError::RaceDetected(context) => { | 126 HgError::RaceDetected(context) => { |
125 write!(f, "encountered a race condition {context}") | 127 write!(f, "encountered a race condition {context}") |
126 } | 128 } |
127 HgError::Path(hg_path_error) => write!(f, "{}", hg_path_error), | 129 HgError::Path(hg_path_error) => write!(f, "{}", hg_path_error), |
130 HgError::InterruptReceived => write!(f, "interrupt received"), | |
128 } | 131 } |
129 } | 132 } |
130 } | 133 } |
131 | 134 |
132 // TODO: use `DisplayBytes` instead to show non-Unicode filenames losslessly? | 135 // TODO: use `DisplayBytes` instead to show non-Unicode filenames losslessly? |