feat: integrate ErrorService for consistent error display and standardize bloc error messages.
This commit is contained in:
@@ -77,7 +77,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
emit(AuthUnauthenticated());
|
||||
}
|
||||
} catch (e) {
|
||||
emit(AuthError(message: e.toString()));
|
||||
emit(AuthError(message: e.toString().replaceAll('Exception: ', '')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
emit(const AuthError(message: 'Invalid email or password'));
|
||||
}
|
||||
} catch (e) {
|
||||
emit(AuthError(message: e.toString()));
|
||||
emit(AuthError(message: e.toString().replaceAll('Exception: ', '')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
emit(const AuthError(message: 'Failed to create account'));
|
||||
}
|
||||
} catch (e) {
|
||||
emit(AuthError(message: e.toString()));
|
||||
emit(AuthError(message: e.toString().replaceAll('Exception: ', '')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
emit(AuthError(message: e.toString()));
|
||||
emit(AuthError(message: e.toString().replaceAll('Exception: ', '')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
emit(const AuthError(message: 'Failed to create account with Google'));
|
||||
}
|
||||
} catch (e) {
|
||||
emit(AuthError(message: e.toString()));
|
||||
emit(AuthError(message: e.toString().replaceAll('Exception: ', '')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
emit(const AuthError(message: 'Failed to create account with Apple'));
|
||||
}
|
||||
} catch (e) {
|
||||
emit(AuthError(message: e.toString()));
|
||||
emit(AuthError(message: e.toString().replaceAll('Exception: ', '')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
emit(AuthError(message: e.toString()));
|
||||
emit(AuthError(message: e.toString().replaceAll('Exception: ', '')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
await _authRepository.resetPassword(event.email);
|
||||
emit(AuthPasswordResetSent(email: event.email));
|
||||
} catch (e) {
|
||||
emit(AuthError(message: e.toString()));
|
||||
emit(AuthError(message: e.toString().replaceAll('Exception: ', '')));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user