rhg: Print an error message in more cases
authorSimon Sapin <simon.sapin@octobus.net>
Wed, 27 Jan 2021 15:04:51 +0100
changeset 46441 741e36f472a5
parent 46440 776b97179c06
child 46442 02d3bb972121
rhg: Print an error message in more cases Differential Revision: https://phab.mercurial-scm.org/D9895
rust/rhg/src/error.rs
--- a/rust/rhg/src/error.rs	Wed Jan 27 14:00:21 2021 +0100
+++ b/rust/rhg/src/error.rs	Wed Jan 27 15:04:51 2021 +0100
@@ -73,7 +73,16 @@
                 )
             }
             CommandError::Abort(message) => message.to_owned(),
-            _ => None,
+
+            CommandError::RequirementsError(_)
+            | CommandError::StdoutError
+            | CommandError::StderrError
+            | CommandError::Unimplemented
+            | CommandError::Other(HgError::UnsupportedFeature(_)) => None,
+
+            CommandError::Other(e) => {
+                Some(format_bytes!(b"{}\n", e.to_string().as_bytes()))
+            }
         }
     }