<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def raise_for_error(self):
 """ raise `ShCmdError` if the proc's return_code is not 0 otherwise return self ..Usage:: True """

        if self.ok:
            return self
        tip = "running {0} @<{1}> error, return code {2}".format(
            " ".join(self.cmd), self.cwd, self.return_code
        )
        logger.error("{0}\nstdout:{1}\nstderr:{2}\n".format(
            tip, self._stdout.decode("utf8"), self._stderr.decode("utf8")
        ))
        raise ShCmdError(self)