mirror of
https://github.com/langgenius/dify.git
synced 2026-03-14 22:02:15 +08:00
When enterprise API returns 403/404, the response contains error JSON instead of expected data structure. Code was accessing fields directly causing KeyError → 500 Internal Server Error. Changes: - Add enterprise-specific error classes (EnterpriseAPIError, etc.) - Implement centralized error validation in EnterpriseRequest.send_request() - Extract error messages from API responses (message/error/detail fields) - Raise domain-specific errors based on HTTP status codes - Preserve backward compatibility with raise_for_status parameter This prevents KeyError crashes and returns proper HTTP error codes (403/404) instead of 500 errors. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| account.py | ||
| app_model_config.py | ||
| app.py | ||
| audio.py | ||
| base.py | ||
| chunk.py | ||
| conversation.py | ||
| dataset.py | ||
| document.py | ||
| enterprise.py | ||
| file.py | ||
| index.py | ||
| llm.py | ||
| message.py | ||
| plugin.py | ||
| workflow_service.py | ||
| workspace.py | ||