From a5342939affdeb5b990882259db303c8a8e4701f Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 13 Sep 2026 04:32:47 +0000 Subject: [PATCH] fix(fonts): log the BDF native-size read failure instead of swallowing it The bdf-native-size lookup in get_fonts_catalog() caught any exception and silently discarded it. Every other guarded read added in this PR (the manifest parse in _declared_widget_script, the SchemaManager fallback in _load_plugin_config_partial) logs before falling through to the same degraded behavior. This one didn't, which is the shape a silent-exception-swallow lint rule flags. Behavior is unchanged -- native_size still comes back None -- but a corrupt or unreadable BDF file now leaves a trace. Verified: font-related tests (140) and the full suite still pass, with only the 2 pre-existing Europe/Kiev/Asia/Calcutta tzdata-alias failures already present on origin/main. Co-Authored-By: Claude Opus 5 --- web_interface/blueprints/api_v3/fonts.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web_interface/blueprints/api_v3/fonts.py b/web_interface/blueprints/api_v3/fonts.py index 2553e581..db0d7d5a 100644 --- a/web_interface/blueprints/api_v3/fonts.py +++ b/web_interface/blueprints/api_v3/fonts.py @@ -92,7 +92,9 @@ def get_fonts_catalog(): try: from src.element_style import _read_bdf_native_size native_size = _read_bdf_native_size(str(filepath)) - except Exception: + except Exception as e: + logger.debug("Could not read native size for BDF font %s: %s", + filepath, e) native_size = None catalog[catalog_key] = {