fix(01-02): resolve compilation errors in auth models
- Fixed import path in AuthRepository to reach core errors - Updated AuthUser.fromSupabase() to handle DateTime parsing safely - Added UnknownAuthException for fallback error handling - Fixed null-aware operators in AuthUser model - All authentication files now compile without errors
This commit is contained in:
@@ -146,6 +146,19 @@ class AuthDisabledException extends AuthException {
|
||||
);
|
||||
}
|
||||
|
||||
/// Exception thrown for unknown authentication errors
|
||||
class UnknownAuthException extends AuthException {
|
||||
const UnknownAuthException({
|
||||
String message = 'An unknown authentication error occurred',
|
||||
String? code,
|
||||
dynamic originalError,
|
||||
}) : super(
|
||||
message: message,
|
||||
code: code ?? 'UNKNOWN_ERROR',
|
||||
originalError: originalError,
|
||||
);
|
||||
}
|
||||
|
||||
/// Utility class for converting Supabase errors to custom exceptions
|
||||
///
|
||||
/// Provides a centralized way to map Supabase error responses
|
||||
@@ -263,7 +276,7 @@ class AuthExceptionFactory {
|
||||
}
|
||||
|
||||
// Fallback for unknown errors
|
||||
return AuthException(
|
||||
return UnknownAuthException(
|
||||
message: _extractUserFriendlyMessage(errorMessage) ?? 'Authentication failed',
|
||||
code: errorCode,
|
||||
originalError: error,
|
||||
|
||||
Reference in New Issue
Block a user