| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| ability.go | ||
| cache.go | ||
| channel.go | ||
| log.go | ||
| main.go | ||
| midjourney.go | ||
| option.go | ||
| pricing.go | ||
| redemption.go | ||
| setup.go | ||
| task.go | ||
| token.go | ||
| token_cache.go | ||
| topup.go | ||
| usedata.go | ||
| user.go | ||
| user_cache.go | ||
| utils.go |
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 |
|---|---|---|
| .. | ||
| ability.go | Loading commit data... | |
| cache.go | Loading commit data... | |
| channel.go | Loading commit data... | |
| log.go | Loading commit data... | |
| main.go | Loading commit data... | |
| midjourney.go | Loading commit data... | |
| option.go | Loading commit data... | |
| pricing.go | Loading commit data... | |
| redemption.go | Loading commit data... | |
| setup.go | Loading commit data... | |
| task.go | Loading commit data... | |
| token.go | Loading commit data... | |
| token_cache.go | Loading commit data... | |
| topup.go | Loading commit data... | |
| usedata.go | Loading commit data... | |
| user.go | Loading commit data... | |
| user_cache.go | Loading commit data... | |
| utils.go | Loading commit data... |