aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/__init__.py12
-rw-r--r--bitbake/lib/bb/command.py7
-rw-r--r--bitbake/lib/bb/providers.py4
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
if sys.version_info < (2, 6, 0):
raise RuntimeError("Sorry, python 2.6.0 or later is required for this version of bitbake")
+
+class BBHandledException(Exception):
+ """
+ The big dilemma for generic bitbake code is what information to give the user
+ when an exception occurs. Any exception inheriting this base exception class
+ has already provided information to the user via some 'fired' message type such as
+ an explicitly fired event using bb.fire, or a bb.error message. If bitbake
+ encounters an exception derived from this class, no backtrace or other information
+ will be given to the user, its assumed the earlier event provided the relevant information.
+ """
+ pass
+
import os
import logging
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:
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):
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
logger = logging.getLogger("BitBake.Provider")
-class NoProvider(Exception):
+class NoProvider(bb.BBHandledException):
"""Exception raised when no provider of a build dependency can be found"""
-class NoRProvider(Exception):
+class NoRProvider(bb.BBHandledException):
"""Exception raised when no provider of a runtime dependency can be found"""