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:
8
src/lib/types/error.ts
Normal file
8
src/lib/types/error.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export interface ApiError {
|
||||
status: number;
|
||||
details: {
|
||||
code: number;
|
||||
msg: string;
|
||||
};
|
||||
name: string;
|
||||
}
|
||||
Reference in New Issue
Block a user