Patchwork D9895: rhg: Print an error message in more cases

login
register
mail settings
Submitter phabricator
Date Jan. 27, 2021, 9:13 p.m.
Message ID <differential-rev-PHID-DREV-efu6oqxcrghcsizxeecf-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48204/
State Superseded
Headers show

Comments

phabricator - Jan. 27, 2021, 9:13 p.m.
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9895

AFFECTED FILES
  rust/rhg/src/error.rs

CHANGE DETAILS




To: SimonSapin, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/rust/rhg/src/error.rs b/rust/rhg/src/error.rs
--- a/rust/rhg/src/error.rs
+++ b/rust/rhg/src/error.rs
@@ -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()))
+            }
         }
     }