mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-05-19 19:50:26 +08:00
b498f0fe91
Replaced all remaining hardcoded error types with AppError::localized for full bilingual support and simplified error handling logic. Backend changes: - usage_script.rs: Converted InvalidHttpMethod to localized error - provider.rs: Replaced all 7 ProviderNotFound instances with localized errors * Line 436: Delete provider validation * Line 625: Update provider metadata * Line 785: Test usage script provider lookup * Line 855: Query usage provider lookup * Line 924: Prepare Codex provider switch * Line 1011: Prepare Claude provider switch * Line 1272: Delete provider snapshot - provider.rs: Simplified error message formatting (removed 40+ lines) * Removed redundant string matching fallback logic * Now uses clean language-based selection for Localized errors * Falls back to default Display for other error types - error.rs: Removed unused error variants * Deleted InvalidHttpMethod (replaced with localized) * Deleted ProviderNotFound (replaced with localized) Code quality improvements: - Reduced complexity: 40+ lines of string matching removed - Better maintainability: Centralized error message handling - Type safety: All provider errors now use consistent localized format Impact: - 100% i18n coverage for provider and usage script error messages - Cleaner, more maintainable error handling code - No unused error variants remaining