dify/api/services/enterprise
GareArc 2b739b9544
fix: handle enterprise API errors properly to prevent KeyError crashes
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.
2026-03-04 19:53:43 -08:00
..
__init__.py Feat/enterprise sso (#3602) 2024-04-18 17:33:32 +08:00
account_deletion_sync.py Squash merge 1.12.1-otel-ee into release/e-1.12.1 2026-03-04 16:59:37 -08:00
base.py fix: handle enterprise API errors properly to prevent KeyError crashes 2026-03-04 19:53:43 -08:00
enterprise_service.py feat(enterprise): auto-join newly registered accounts to the default workspace (#32308) 2026-03-02 16:38:43 +08:00
plugin_manager_service.py feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
workspace_sync.py feat: credential sync fix for enterprise edition (#30626) 2026-01-14 23:33:24 -08:00