summaryrefslogtreecommitdiffstats
path: root/base/base.py
diff options
context:
space:
mode:
authorYaakov M. Nemoy <loupgaroublond@gmail.com>2008-10-02 19:22:06 -0400
committerYaakov M. Nemoy <loupgaroublond@gmail.com>2008-10-02 19:22:06 -0400
commit53bbc48597fa598a2c1a5ee780bda0efee679462 (patch)
tree3822b1109703844bc9af667116e09cec2c5eefb9 /base/base.py
parent8cde181d89839ee2c9588b50c336ac5d55bc0d3d (diff)
downloadfedora-devshell-53bbc48597fa598a2c1a5ee780bda0efee679462.tar.gz
fedora-devshell-53bbc48597fa598a2c1a5ee780bda0efee679462.tar.xz
fedora-devshell-53bbc48597fa598a2c1a5ee780bda0efee679462.zip
Added exception for bad function call.
We can use this to deliver *good* inforamtion to the user what went wrong, and how to rectify it if possible.
Diffstat (limited to 'base/base.py')
-rw-r--r--base/base.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/base/base.py b/base/base.py
index 68677bc..afa0df4 100644
--- a/base/base.py
+++ b/base/base.py
@@ -8,6 +8,7 @@ from os.path import join, dirname
from module import Module
from vars import __description__, __version__, header, prompt
+from exceptions import ModuleError, ExecutionException
log = logging.getLogger('devshell')
@@ -165,7 +166,11 @@ def do_command(data, top=None):
params += [param]
output = None
if len(params):
- output = top(*params)
+ try:
+ output = top(*params)
+ except ExecutionException, e:
+ # TODO: maket his as helpful as possible to the user
+ log.critical('execution of command failed because: %s' % e.message)
if module:
return output, module, mod_params