summaryrefslogtreecommitdiffstats
path: root/lib/bb/command.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-09 17:01:51 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-10 17:40:29 +0000
commiteac9249b40ae1e3aa21e016010c862664e59a8d4 (patch)
treeb44c9fb6b2102446bb2a4c80e68bcd93baf1a7e6 /lib/bb/command.py
parent9943bad611a974e4d37a00c7a4de1752250370c5 (diff)
downloadbitbake-contrib-eac9249b40ae1e3aa21e016010c862664e59a8d4.tar.gz
bitbake: Add BBHandledException exception class
We have a problem knowing when to show the user debug information and when not to since the code has already shown the user suitable information about why a failure is occurring. This patch adds a bb.BBHandledException exception class which can be used to identify those exceptions which don't need further explanation to the user. This patch uses this class for the bb.providers exceptions and ensures the command handling code correctly filters the exceptions meaning that "bitbake invalid" now shows an simple error message and not a python traceback. [YOCTO #1141 partial] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/command.py')
-rw-r--r--lib/bb/command.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/bb/command.py b/lib/bb/command.py
index f236daceb..2a3a3afac 100644
--- a/lib/bb/command.py
+++ b/lib/bb/command.py
@@ -98,9 +98,12 @@ class Command:
else:
self.finishAsyncCommand("Exited with %s" % arg)
return False
- except Exception:
+ except Exception as exc:
import traceback
- self.finishAsyncCommand(traceback.format_exc())
+ if isinstance(exc, bb.BBHandledException):
+ self.finishAsyncCommand("")
+ else:
+ self.finishAsyncCommand(traceback.format_exc())
return False
def finishAsyncCommand(self, msg=None, code=None):