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`).
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| channel | Loading commit data... | |
| common | Loading commit data... | |
| common_handler | Loading commit data... | |
| constant | Loading commit data... | |
| helper | Loading commit data... | |
| audio_handler.go | Loading commit data... | |
| claude_handler.go | Loading commit data... | |
| embedding_handler.go | Loading commit data... | |
| gemini_handler.go | Loading commit data... | |
| image_handler.go | Loading commit data... | |
| relay-mj.go | Loading commit data... | |
| relay-text.go | Loading commit data... | |
| relay_adaptor.go | Loading commit data... | |
| relay_task.go | Loading commit data... | |
| rerank_handler.go | Loading commit data... | |
| responses_handler.go | Loading commit data... | |
| websocket.go | Loading commit data... |