diff options
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/__init__.py | 12 | ||||
-rw-r--r-- | bitbake/lib/bb/command.py | 7 | ||||
-rw-r--r-- | bitbake/lib/bb/providers.py | 4 |
3 files changed, 19 insertions, 4 deletions
diff --git a/bitbake/lib/bb/__init__.py b/bitbake/lib/bb/__init__.py index 5dc959c7e5..81f83c88d5 100644 --- a/bitbake/lib/bb/__init__.py +++ b/bitbake/lib/bb/__init__.py | |||
@@ -27,6 +27,18 @@ import sys | |||
27 | if sys.version_info < (2, 6, 0): | 27 | if sys.version_info < (2, 6, 0): |
28 | raise RuntimeError("Sorry, python 2.6.0 or later is required for this version of bitbake") | 28 | raise RuntimeError("Sorry, python 2.6.0 or later is required for this version of bitbake") |
29 | 29 | ||
30 | |||
31 | class BBHandledException(Exception): | ||
32 | """ | ||
33 | The big dilemma for generic bitbake code is what information to give the user | ||
34 | when an exception occurs. Any exception inheriting this base exception class | ||
35 | has already provided information to the user via some 'fired' message type such as | ||
36 | an explicitly fired event using bb.fire, or a bb.error message. If bitbake | ||
37 | encounters an exception derived from this class, no backtrace or other information | ||
38 | will be given to the user, its assumed the earlier event provided the relevant information. | ||
39 | """ | ||
40 | pass | ||
41 | |||
30 | import os | 42 | import os |
31 | import logging | 43 | import logging |
32 | 44 | ||
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index f236daceb1..2a3a3afaca 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py | |||
@@ -98,9 +98,12 @@ class Command: | |||
98 | else: | 98 | else: |
99 | self.finishAsyncCommand("Exited with %s" % arg) | 99 | self.finishAsyncCommand("Exited with %s" % arg) |
100 | return False | 100 | return False |
101 | except Exception: | 101 | except Exception as exc: |
102 | import traceback | 102 | import traceback |
103 | self.finishAsyncCommand(traceback.format_exc()) | 103 | if isinstance(exc, bb.BBHandledException): |
104 | self.finishAsyncCommand("") | ||
105 | else: | ||
106 | self.finishAsyncCommand(traceback.format_exc()) | ||
104 | return False | 107 | return False |
105 | 108 | ||
106 | def finishAsyncCommand(self, msg=None, code=None): | 109 | def finishAsyncCommand(self, msg=None, code=None): |
diff --git a/bitbake/lib/bb/providers.py b/bitbake/lib/bb/providers.py index 4543447057..398c8ea115 100644 --- a/bitbake/lib/bb/providers.py +++ b/bitbake/lib/bb/providers.py | |||
@@ -28,10 +28,10 @@ import bb | |||
28 | 28 | ||
29 | logger = logging.getLogger("BitBake.Provider") | 29 | logger = logging.getLogger("BitBake.Provider") |
30 | 30 | ||
31 | class NoProvider(Exception): | 31 | class NoProvider(bb.BBHandledException): |
32 | """Exception raised when no provider of a build dependency can be found""" | 32 | """Exception raised when no provider of a build dependency can be found""" |
33 | 33 | ||
34 | class NoRProvider(Exception): | 34 | class NoRProvider(bb.BBHandledException): |
35 | """Exception raised when no provider of a runtime dependency can be found""" | 35 | """Exception raised when no provider of a runtime dependency can be found""" |
36 | 36 | ||
37 | 37 | ||