taskwarrior/test/basetest/exceptions.py
Renato Alves 715a414abd UnitTests
* Taskd and Taskw classes for testing are now available
 * Testing of server and client can now be performed.
 * The newer test wrappers will eventually replace the BaseTest class
2014-07-06 02:03:04 +01:00

20 lines
533 B
Python

# -*- coding: utf-8 -*-
class CommandError(Exception):
def __init__(self, cmd, code, out, err, msg=None):
if msg is None:
self.msg = ("Command '{0}' finished with unexpected exit code "
"'{1}':\nStdout: '{2}'\nStderr: '{3}'")
else:
self.msg = msg
self.cmd = cmd
self.out = out
self.err = err
self.code = code
def __str__(self):
return self.msg.format(self.cmd, self.code, self.out, self.err)
# vim: ai sts=4 et sw=4