fix(auth): handle API error types correctly in login action

- Introduce ApiError interface for better type safety
- Replace generic HttpError handling with specific ApiError casting
- Remove unnecessary console log in error handling block
- Ensure error details are properly extracted and returned to client
This commit is contained in:
Chaos
2025-11-24 17:26:37 +08:00
parent d4ace86fb3
commit f9d92e6cc9
2 changed files with 11 additions and 2 deletions

8
src/lib/types/error.ts Normal file
View File

@@ -0,0 +1,8 @@
export interface ApiError {
status: number;
details: {
code: number;
msg: string;
};
name: string;
}