feat: integrate ErrorService for consistent error display and standardize bloc error messages.

This commit is contained in:
Van Leemput Dayron
2025-12-02 13:59:40 +01:00
parent 1e70b9e09f
commit 6757cb013a
24 changed files with 927 additions and 608 deletions

View File

@@ -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: ', '')));
}
}
}