# HG changeset patch # User drewp@bigasterisk.com # Date 1723493679 25200 # Node ID 789042521535d069cf19c3f1ce1460fba6aa674d # Parent 82cec89e65341f40bfd632449a68be1362eb645a crash on regexp syntax errors diff -r 82cec89e6534 -r 789042521535 mqtt_metrics.py --- a/mqtt_metrics.py Sun Aug 11 18:28:53 2024 -0700 +++ b/mqtt_metrics.py Mon Aug 12 13:14:39 2024 -0700 @@ -104,7 +104,12 @@ metricEvents: list[dict] = [] matchedPats = [] for converter in converters: - if not (m := re.search(converter.topic_pattern, message['topic'])): + try: + m = re.search(converter.topic_pattern, message['topic']) + except Exception: + log.error('re.search', exc_info=True) + os.abort() + if not m: continue if not matchedPats: try: