mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] forwardport: error reporting when git command fails
- if stderr was empty or had been redirected to stdout, no useful information would be show, making debugging more complicated - the fallback is the error itself, but since it's reraised odds are pretty high the caller will eventually log the error itself, so it's redundant => fallback to stdout if stderr is empty, and only log if either is non-empty
This commit is contained in:
parent
6281c86d5e
commit
22c3406659
@ -1146,7 +1146,8 @@ class Repo:
|
||||
try:
|
||||
return self._opener(args, **opts)
|
||||
except subprocess.CalledProcessError as e:
|
||||
_logger.error("git call error:%s", ('\n' + e.stderr.decode()) if e.stderr else e )
|
||||
stream = e.stderr if e.stderr else e.stdout if e.stdout else ''
|
||||
_logger.error("git call error%s%s", stream and ': ', stream)
|
||||
raise
|
||||
|
||||
def stdout(self, flag=True):
|
||||
|
Loading…
Reference in New Issue
Block a user