From 5d5b0c11bdb65f2c07c67aba8150a7081b0fef86 Mon Sep 17 00:00:00 2001 From: harshadkhetpal Date: Sun, 12 Apr 2026 21:21:30 +0530 Subject: [PATCH 1/3] fix: replace bare except with except Exception in transformer.py --- src/robusta/core/sinks/transformer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/robusta/core/sinks/transformer.py b/src/robusta/core/sinks/transformer.py index 7d2daeb8c..ce7efd041 100644 --- a/src/robusta/core/sinks/transformer.py +++ b/src/robusta/core/sinks/transformer.py @@ -87,7 +87,7 @@ def trim_markdown(text: str, max_length: int, suffix: str = "...") -> str: def apply_length_limit_to_markdown(msg: str, max_length: int, truncator: str = "...") -> str: try: return Transformer.trim_markdown(msg, max_length, truncator) - except: + except Exception: return Transformer.apply_length_limit(msg, max_length, truncator) @staticmethod From 7a8b5ac49bca0155f95fe03b56af2a8fd65a164c Mon Sep 17 00:00:00 2001 From: harshadkhetpal Date: Sun, 12 Apr 2026 21:21:31 +0530 Subject: [PATCH 2/3] fix: replace bare except with except Exception in models.py --- src/robusta/integrations/prometheus/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/robusta/integrations/prometheus/models.py b/src/robusta/integrations/prometheus/models.py index 8d07e48e4..3b288b233 100644 --- a/src/robusta/integrations/prometheus/models.py +++ b/src/robusta/integrations/prometheus/models.py @@ -39,7 +39,7 @@ def update_severity_map(global_config): custom_severity_map = global_config.get("custom_severity_map", {}) for key in custom_severity_map.keys(): SEVERITY_MAP[key] = FindingSeverity.from_severity(custom_severity_map[key].upper()) - except: + except Exception: logging.exception("Failed to map custom severities") From 276985ba8f529f417f23dd3b29e14da6c600bd14 Mon Sep 17 00:00:00 2001 From: harshadkhetpal Date: Sun, 12 Apr 2026 21:21:32 +0530 Subject: [PATCH 3/3] fix: replace bare except with except Exception in prometheus_discovery_utils.py --- src/robusta/core/sinks/robusta/prometheus_discovery_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/robusta/core/sinks/robusta/prometheus_discovery_utils.py b/src/robusta/core/sinks/robusta/prometheus_discovery_utils.py index 897e548fb..db6305695 100644 --- a/src/robusta/core/sinks/robusta/prometheus_discovery_utils.py +++ b/src/robusta/core/sinks/robusta/prometheus_discovery_utils.py @@ -73,7 +73,7 @@ def _get_query_prometheus_value(self, query: str) -> Optional[float]: value = query_result.vector_result[0]["value"]["value"] return_value = float("%.2f" % float(value)) return return_value if return_value >= 0 else None - except: + except Exception: logging.exception("PrometheusDiscoveryUtils failed to get prometheus results.") return