Improve error reporting.
This commit is contained in:
parent
43a65d91b1
commit
f09765a03a
5 changed files with 68 additions and 29 deletions
|
|
@ -343,10 +343,8 @@ class Remote(object):
|
|||
util.log_std_fd(self.log, command, stdout, 'Remote stdout')
|
||||
|
||||
return output
|
||||
except subprocess.CalledProcessError as e:
|
||||
util.handle_called_process_error(e, command)
|
||||
except OSError as error:
|
||||
raise cdist.Error(" ".join(command) + ": " + error.args[1])
|
||||
except (OSError, subprocess.CalledProcessError) as error:
|
||||
raise cdist.Error(" ".join(command) + ": " + str(error.args[1]))
|
||||
except UnicodeDecodeError:
|
||||
raise DecodeError(command)
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue