Files
new-api/common
CaIon 98952198bb refactor: Introduce standardized API error
This commit refactors the application's error handling mechanism by introducing a new standardized error type, `types.NewAPIError`. It also renames common JSON utility functions for better clarity.

Previously, internal error handling was tightly coupled to the `dto.OpenAIError` format. This change decouples the internal logic from the external API representation.

Key changes:
- A new `types.NewAPIError` struct is introduced to serve as a canonical internal representation for all API errors.
- All relay adapters (OpenAI, Claude, Gemini, etc.) are updated to return `*types.NewAPIError`.
- Controllers now convert the internal `NewAPIError` to the client-facing `OpenAIError` format at the API boundary, ensuring backward compatibility.
- Channel auto-disable/enable logic is updated to use the new standardized error type.
- JSON utility functions are renamed to align with Go's standard library conventions (e.g., `UnmarshalJson` -> `Unmarshal`, `EncodeJson` -> `Marshal`).
2025-07-10 15:02:40 +08:00
..
2025-03-12 21:31:46 +08:00
2023-04-22 20:39:27 +08:00
2024-07-07 02:24:51 +08:00
2025-06-25 18:42:19 +08:00
2023-11-21 18:11:07 +08:00
2023-04-22 20:39:27 +08:00
2024-06-27 19:30:17 +08:00
2023-04-22 20:39:27 +08:00
2023-04-22 20:39:27 +08:00