| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 27c577d commit 48f5476
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -380,7 +380,10 @@ def execute(self, command, | |||
| 380 | 380 | # END handle debug printing | |
| 381 | 381 | ||
| 382 | 382 | if with_exceptions and status != 0: | |
| 383 | - raise GitCommandError(command, status, stderr_value) | ||
| 383 | + if with_extended_output: | ||
| 384 | + raise GitCommandError(command, status, stderr_value, stdout_value) | ||
| 385 | + else: | ||
| 386 | + raise GitCommandError(command, status, stderr_value) | ||
| 384 | 387 | ||
| 385 | 388 | # Allow access to the command's status code | |
| 386 | 389 | if with_extended_output: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,14 +17,18 @@ class NoSuchPathError(OSError): | |||
| 17 | 17 | ||
| 18 | 18 | class GitCommandError(Exception): | |
| 19 | 19 | """ Thrown if execution of the git command fails with non-zero status code. """ | |
| 20 | - def __init__(self, command, status, stderr=None): | ||
| 20 | + def __init__(self, command, status, stderr=None, stdout=None): | ||
| 21 | 21 | self.stderr = stderr | |
| 22 | + self.stdout = stdout | ||
| 22 | 23 | self.status = status | |
| 23 | 24 | self.command = command | |
| 24 | 25 | ||
| 25 | 26 | def __str__(self): | |
| 26 | - return ("'%s' returned exit status %i: %s" % | ||
| 27 | - (' '.join(str(i) for i in self.command), self.status, self.stderr)) | ||
| 27 | + ret = "'%s' returned exit status %i: %s" % \ | ||
| 28 | + (' '.join(str(i) for i in self.command), self.status, self.stderr) | ||
| 29 | + if self.stdout is not None: | ||
| 30 | + ret += "\nstdout: %s" % self.stdout | ||
| 31 | + return ret | ||
| 28 | 32 | ||
| 29 | 33 | ||
| 30 | 34 | class CheckoutError( Exception ): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments