feat: Enhance placeholder resolution and error handling
Deploy Development / deploy (push) Successful in 55s
Build Test / pytest-backend (push) Successful in 4s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 17s

- Updated `extract_value_raw` to improve JSON parsing and handle unavailable data more effectively.
- Introduced new functions in `placeholder_resolver.py` for standardized responses when data is unavailable, enhancing clarity for users and AI.
- Modified various data retrieval functions to utilize the new response format, providing detailed reasons for unavailability.
- Improved availability checks in `export_placeholder_values_extended` to account for new response formats.

These changes enhance the robustness of the placeholder system and improve user experience by providing clearer error messages and data handling.
This commit is contained in:
Lars committed 2026-04-11 21:22:27 +02:00
1 parent 052ba195cc
commit 04e23d8115
4 files changed
+320 -34

No files matched your search

+8 -2
View File
@@ -583,8 +583,14 @@ def export_placeholder_values_extended(
if 'value_raw' not in metadata.unresolved_fields:
metadata.unresolved_fields.append('value_raw')
# Check availability
if value in ['nicht verfügbar', 'nicht genug Daten', '[Fehler:', '[Nicht']:
# Check availability (Resolver liefert oft „nicht verfügbar — <Grund>“)
sv = str(value)
if (
sv in ['nicht verfügbar', 'nicht genug Daten']
or sv.startswith('nicht verfügbar —')
or sv.startswith('[Fehler:')
or sv.startswith('[Nicht')
):
metadata.available = False
metadata.missing_reason = value
else: