diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-12-10 10:51:47 -0500 |
---|---|---|
committer | Chris Larson <chris_larson@mentor.com> | 2010-12-10 10:51:50 -0500 |
commit | 240d4a7ae80a6636c302ae84266ddfed7a7fcedd (patch) | |
tree | 878e4d42b280b6137bf19745a0c02334d2c4c91c /bin | |
parent | 20929afdd87e5124891f121c3640aa9efa368c2c (diff) | |
download | bitbake-240d4a7ae80a6636c302ae84266ddfed7a7fcedd.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.
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/bitbake | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/bin/bitbake b/bin/bitbake index 41060ae23..540a5a2e1 100755 --- a/bin/bitbake +++ b/bin/bitbake @@ -56,17 +56,6 @@ class BBConfiguration(object): self.pkgs_to_build = [] -def print_exception(*exc_info): - if not isinstance(exc_info[0], SystemExit): - if isinstance(exc_info[0], KeyboardInterrupt): - logger.error("User aborted.") - else: - logger.error("Uncaught exception: ", exc_info=exc_info) - sys.exit(1) - -sys.excepthook = print_exception - - # Display bitbake/OE warnings via the BitBake.Warnings logger, ignoring others""" warnlog = logging.getLogger("BitBake.Warnings") _warnings_showwarning = warnings.showwarning @@ -210,5 +199,10 @@ Default BBFILES are the .bb files in the current directory.""") server_connection.terminate() if __name__ == "__main__": - ret = main() + try: + ret = main() + except Exception: + ret = 1 + import traceback + traceback.print_exc(5) sys.exit(ret) |