summaryrefslogtreecommitdiffstats
path: root/ipalib/errors2.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib/errors2.py')
-rw-r--r--ipalib/errors2.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/ipalib/errors2.py b/ipalib/errors2.py
index 7793a9146..7fd4b9c95 100644
--- a/ipalib/errors2.py
+++ b/ipalib/errors2.py
@@ -67,15 +67,19 @@ class SubprocessError(PrivateError):
For example:
+ >>> raise SubprocessError(returncode=2, argv=('ls', '-lh', '/no-foo/'))
+ Traceback (most recent call last):
+ ...
+ SubprocessError: return code 2 from ('ls', '-lh', '/no-foo/')
+
+ The exit code of the sub-process is available via the ``returncode``
+ instance attribute. For example:
+
>>> e = SubprocessError(returncode=1, argv=('/bin/false',))
>>> e.returncode
1
- >>> e.argv
+ >>> e.argv # argv is also available
('/bin/false',)
- >>> e.message
- "return code 1 from ('/bin/false',)"
- >>> str(e)
- "return code 1 from ('/bin/false',)"
"""
format = 'return code %(returncode)d from %(argv)r'