Skip to content

Commit

Permalink
remove errmsg param; close databio#111
Browse files Browse the repository at this point in the history
  • Loading branch information
vreuter committed Mar 21, 2019
1 parent 24be3c3 commit 0cb85d8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pypiper/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ def call_follow():

return process_return_code

def checkprint(self, cmd, shell=None, nofail=False, errmsg=None):
def checkprint(self, cmd, shell=None, nofail=False):
"""
Just like callprint, but checks output -- so you can get a variable
in python corresponding to the return value of the command you call.
Expand All @@ -784,7 +784,6 @@ def checkprint(self, cmd, shell=None, nofail=False, errmsg=None):
:param bool nofail: Should the pipeline bail on a nonzero return from a process? Default: False
Nofail can be used to implement non-essential parts of the pipeline; if these processes fail,
they will not cause the pipeline to bail out.
:param str errmsg: Message to print if there's an error.
"""

self._report_command(cmd)
Expand All @@ -802,7 +801,7 @@ def checkprint(self, cmd, shell=None, nofail=False, errmsg=None):
try:
return subprocess.check_output(cmd, shell=shell)
except Exception as e:
self._triage_error(e, nofail, errmsg)
self._triage_error(e, nofail)

def callprint(self, cmd, shell=None, lock_file=None, nofail=False, container=None):
"""
Expand Down Expand Up @@ -1943,10 +1942,8 @@ def _memory_usage(self, pid='self', category="hwm", container=None):
# print(result[category])
return result[category]

def _triage_error(self, e, nofail, errmsg=None):
def _triage_error(self, e, nofail):
""" Print a message and decide what to do about an error. """
if errmsg is not None:
print(errmsg)
if not nofail:
self.fail_pipeline(e)
elif self.failed:
Expand Down

0 comments on commit 0cb85d8

Please sign in to comment.