diff mbox series

[2.0,4/4] cookerdata: Drop dubious exception handling code

Message ID 20230310204601.730833-4-Martin.Jansa@gmail.com
State Accepted, archived
Commit a29ffcc12df24737e702e198aeb8f6892884932b
Headers show
Series [2.0,1/4] utils: Allow to_boolean to support int values | expand

Commit Message

Martin Jansa March 10, 2023, 8:46 p.m. UTC
From: Richard Purdie <richard.purdie@linuxfoundation.org>

This code appears to be dangerous, it swallows exceptions, turning them into
"handled" versions which then show no errors to the user. This is a pretty
poor user experience and I can't see why this code should be swallowing
such things. Drop the worst bits of code.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/cookerdata.py | 5 -----
 1 file changed, 5 deletions(-)
diff mbox series

Patch

diff --git a/lib/bb/cookerdata.py b/lib/bb/cookerdata.py
index e2dbb3b21..ec3741cc1 100644
--- a/lib/bb/cookerdata.py
+++ b/lib/bb/cookerdata.py
@@ -293,14 +293,9 @@  class CookerDataBuilder(object):
                 bb.event.fire(bb.event.MultiConfigParsed(self.mcdata), self.data)
 
             self.data_hash = data_hash.hexdigest()
-        except (SyntaxError, bb.BBHandledException):
-            raise bb.BBHandledException()
         except bb.data_smart.ExpansionError as e:
             logger.error(str(e))
             raise bb.BBHandledException()
-        except Exception:
-            logger.exception("Error parsing configuration files")
-            raise bb.BBHandledException()
 
 
         # Handle obsolete variable names