summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2013-01-27 15:41:20 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-28 12:43:58 +0000
commitf3acb135e723258bd4b6072d5737d52e13d47054 (patch)
tree3ffa0492ceb3cce8c3094e21d239f048caedcc62 /bitbake/lib/bb/ui/crumbs/hobeventhandler.py
parent878ef6a31c2cea4b6a1012f5b5e29a3bc4d01119 (diff)
downloadpoky-f3acb135e723258bd4b6072d5737d52e13d47054.tar.gz
bitbake: command: add error to return of runCommand
Currently, command.py can return an error message from runCommand, due to being unable to run the command, yet few of our UIs (just hob) can handle it today. This can result in seeing a TypeError with traceback in certain rare circumstances. To resolve this, we need a clean way to get errors back from runCommand, without having to isinstance() the return value. This implements such a thing by making runCommand also return an error (or None if no error occurred). As runCommand now has a method of returning errors, we can also alter the getCmdLineAction bits such that the returned value is just the action, not an additional message. If a sync command wants to return an error, it raises CommandError(message), and the message will be passed to the caller appropriately. Example Usage: result, error = server.runCommand(...) if error: log.error('Unable to run command: %s' % error) return 1 (Bitbake rev: 717831b8315cb3904d9b590e633000bc897e8fb6) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/hobeventhandler.py')
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobeventhandler.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index 52acec1028..21bea236c4 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -102,7 +102,10 @@ class HobHandler(gobject.GObject):
102 102
103 def runCommand(self, commandline): 103 def runCommand(self, commandline):
104 try: 104 try:
105 return self.server.runCommand(commandline) 105 result, error = self.server.runCommand(commandline)
106 if error:
107 raise Exception("Error running command '%s': %s" % (commandline, error))
108 return result
106 except Exception as e: 109 except Exception as e:
107 self.commands_async = [] 110 self.commands_async = []
108 self.clear_busy() 111 self.clear_busy()