summaryrefslogtreecommitdiffstats
path: root/py/mock/exception.py
diff options
context:
space:
mode:
authorMichael E Brown <mebrown@michaels-house.net>2008-11-18 17:29:02 -0600
committerMichael E Brown <mebrown@michaels-house.net>2008-11-18 17:29:02 -0600
commit3eaddeb432b8755345f50acaf370be9146eb551e (patch)
tree564a08c110e5cf284898634782e766da846f0b04 /py/mock/exception.py
parentf361fde09b4063026dc1e644511db3041dec275d (diff)
downloadmock-3eaddeb432b8755345f50acaf370be9146eb551e.tar.gz
mock-3eaddeb432b8755345f50acaf370be9146eb551e.tar.xz
mock-3eaddeb432b8755345f50acaf370be9146eb551e.zip
add new exception for result dir not being accessible and print nice friendly error message.
Diffstat (limited to 'py/mock/exception.py')
-rw-r--r--py/mock/exception.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/py/mock/exception.py b/py/mock/exception.py
index d02bddb..3c84606 100644
--- a/py/mock/exception.py
+++ b/py/mock/exception.py
@@ -35,6 +35,7 @@ class Error(Exception):
# 40 = some error in the pkg we're building
# 50 = tried to fork a subcommand and it errored out
# 60 = buildroot locked
+# 70 = result dir could not be created
class BuildError(Error):
"rpmbuild failed."
@@ -77,3 +78,16 @@ class BadCmdline(Error):
Error.__init__(self, msg)
self.msg = msg
self.resultcode = 05
+
+class ResultDirNotAccessible(Error):
+ """
+Could not create output directory for built rpms. The directory specified was:
+ %s
+
+Try using the --resultdir= option to select another location. Recommended location is --resultdir=~/mock/.
+"""
+ def __init__(self, msg):
+ Error.__init__(self, msg)
+ self.msg = msg
+ self.resultcode = 70
+