equal
deleted
inserted
replaced
31 /// The message is a short explanation for users, not intended to be |
31 /// The message is a short explanation for users, not intended to be |
32 /// machine-readable. |
32 /// machine-readable. |
33 Abort { |
33 Abort { |
34 message: String, |
34 message: String, |
35 detailed_exit_code: exit_codes::ExitCode, |
35 detailed_exit_code: exit_codes::ExitCode, |
|
36 hint: Option<String>, |
36 }, |
37 }, |
37 |
38 |
38 /// A configuration value is not in the expected syntax. |
39 /// A configuration value is not in the expected syntax. |
39 /// |
40 /// |
40 /// These errors can happen in many places in the code because values are |
41 /// These errors can happen in many places in the code because values are |
80 } |
81 } |
81 |
82 |
82 pub fn abort( |
83 pub fn abort( |
83 explanation: impl Into<String>, |
84 explanation: impl Into<String>, |
84 exit_code: exit_codes::ExitCode, |
85 exit_code: exit_codes::ExitCode, |
|
86 hint: Option<String>, |
85 ) -> Self { |
87 ) -> Self { |
86 HgError::Abort { |
88 HgError::Abort { |
87 message: explanation.into(), |
89 message: explanation.into(), |
88 detailed_exit_code: exit_code, |
90 detailed_exit_code: exit_code, |
|
91 hint, |
89 } |
92 } |
90 } |
93 } |
91 } |
94 } |
92 |
95 |
93 // TODO: use `DisplayBytes` instead to show non-Unicode filenames losslessly? |
96 // TODO: use `DisplayBytes` instead to show non-Unicode filenames losslessly? |