Skip to contentSkip to conversation

cookerdata.py: Catch BBHandledException, preventing a backtrace in an event

PATCH New Mark Hatle 1 participant 1 message Sep 15, 2016

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

PATCH 1/1 cookerdata.py: Catch BBHandledException, preventing a backtrace in an event

The event handling 'Exception' was catching and triggering a backtrace. This trace was obscuring any errors from an event handler that had raised the BBHandledException, which should indicate do not print additional information.

---
 lib/bb/cookerdata.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/cookerdata.py +1 -1
index bf9bfbf..9d25aa2 100644
@@ -284,7 +284,7 @@ class CookerDataBuilder(object):
                 bb.event.fire(bb.event.ConfigParsed(), mcdata)
                 self.mcdata[config] = mcdata
 
-        except SyntaxError:
+        except (SyntaxError, bb.BBHandledException):
             raise bb.BBHandledException
         except bb.data_smart.ExpansionError as e:
             logger.error(str(e))
Signature · 1 line
2.5.5