Skip to content
Browse files

Better error message if some external command fails

Include the command in the error message.
  • Loading branch information...
1 parent d323122 commit 1192531f598f68063c3c999a757ae32de638eebe @dvarrazzo committed Mar 13, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 pgxnclient/commands/__init__.py
View
8 pgxnclient/commands/__init__.py
@@ -463,8 +463,8 @@ def call_pg_config(self, what, _cache={}):
p = self.popen(cmdline, stdout=PIPE, shell=True)
out, err = p.communicate()
if p.returncode:
- raise PgxnClientException(
- "%s returned %s" % (cmdline, p.returncode))
+ raise ProcessError(_("command returned %s: %s")
+ % (p.returncode, cmdline))
out = out.rstrip().decode('utf-8')
rv = _cache[what] = out
@@ -516,8 +516,8 @@ def run_make(self, cmd, dir, env=None, sudo=None):
p = self.popen(cmdline, cwd=dir, shell=False, env=env, close_fds=True)
p.communicate()
if p.returncode:
- raise PgxnClientException(
- _("command returned %s") % p.returncode)
+ raise ProcessError(_("command returned %s: %s")
+ % (p.returncode, ' '.join(cmdline)))
class WithSudo(object):

0 comments on commit 1192531

Please sign in to comment.
Something went wrong with that request. Please try again.