feat: Enhance placeholder resolution and error handling
- 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:
1 parent
052ba195cc
commit
04e23d8115
4 files changed
+320
-34
No files matched your search
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user