summaryrefslogtreecommitdiffstats
path: root/bitbake/bin/bitbake
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-12-10 10:51:47 -0500
committerRichard Purdie <rpurdie@linux.intel.com>2011-01-04 14:46:48 +0000
commit3d3af810fa5c049b23bba1069f1653aef5fe361f (patch)
tree34ea720b2a41e39974fc826aca84810cc2d5ebf5 /bitbake/bin/bitbake
parent6f80455777c9d26c3af250904f455cb2bb1fc75a (diff)
downloadpoky-3d3af810fa5c049b23bba1069f1653aef5fe361f.tar.gz
Kill the uncaught exception handler
We now wrap the main() in a try/except, ensuring that both the main portion of bin/bitbake and the UI raising an exception will be shown to the user. For the server and workers, we can ensure in the server itself that exceptions are handled correctly. (Bitbake rev: 240d4a7ae80a6636c302ae84266ddfed7a7fcedd) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/bin/bitbake')
-rwxr-xr-xbitbake/bin/bitbake18
1 files changed, 6 insertions, 12 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index 51cb87e285..9b68c23a9b 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -57,17 +57,6 @@ class BBConfiguration(object):
57 self.pkgs_to_build = [] 57 self.pkgs_to_build = []
58 58
59 59
60def print_exception(*exc_info):
61 if not isinstance(exc_info[0], SystemExit):
62 if isinstance(exc_info[0], KeyboardInterrupt):
63 logger.error("User aborted.")
64 else:
65 logger.error("Uncaught exception: ", exc_info=exc_info)
66 sys.exit(1)
67
68sys.excepthook = print_exception
69
70
71# Display bitbake/OE warnings via the BitBake.Warnings logger, ignoring others""" 60# Display bitbake/OE warnings via the BitBake.Warnings logger, ignoring others"""
72warnlog = logging.getLogger("BitBake.Warnings") 61warnlog = logging.getLogger("BitBake.Warnings")
73_warnings_showwarning = warnings.showwarning 62_warnings_showwarning = warnings.showwarning
@@ -216,5 +205,10 @@ Default BBFILES are the .bb files in the current directory.""")
216 server_connection.terminate() 205 server_connection.terminate()
217 206
218if __name__ == "__main__": 207if __name__ == "__main__":
219 ret = main() 208 try:
209 ret = main()
210 except Exception:
211 ret = 1
212 import traceback
213 traceback.print_exc(5)
220 sys.exit(ret) 214 sys.exit(ret)