Skip to contentSkip to conversation

bitbake: Handle BBMainException

PATCH New Ed Bartosh 1 participant 1 message Apr 28, 2015

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 bitbake: Handle BBMainException

Some error messages were lost because BBMainException was inherited from bb.BBHandledException. When bb.BBHandledException is processed error messages are not printed as they suppose to be printed before raising this exception.

Stopped to inherit BBMainException from bb.BBHandledException. Handled BBMainException in bin/bitbake and printed error message to the stderr.

---
 bitbake/bin/bitbake    | 5 ++++-
 bitbake/lib/bb/main.py | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)
bitbake/bin/bitbake +4 -1
index af91507..3e1ca62 100755
@@ -33,12 +33,15 @@ except RuntimeError as exc:
     sys.exit(str(exc))
 
 from bb import cookerdata
-from bb.main import bitbake_main, BitBakeConfigParameters
+from bb.main import bitbake_main, BitBakeConfigParameters, BBMainException
 
 if __name__ == "__main__":
     try:
         ret = bitbake_main(BitBakeConfigParameters(sys.argv),
                            cookerdata.CookerConfiguration())
+    except BBMainException as err:
+        print >>sys.stderr, err
+        ret = 1
     except bb.BBHandledException:
         ret = 1
     except Exception:
bitbake/lib/bb/main.py +1 -1
index af067f7..2019d50 100755
@@ -39,7 +39,7 @@ from bb import cookerdata
 __version__ = "1.27.0"
 logger = logging.getLogger("BitBake")
 
-class BBMainException(bb.BBHandledException):
+class BBMainException(Exception):
     pass
 
 def get_ui(config):
Signature · 1 line
2.1.4