Skip to content

Commit d54960b

Browse files
committed
fix(auth): Improve HTTP error message handling
- Handle empty HTTP error messages
1 parent ceb3612 commit d54960b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/authentication/bloc/authentication_bloc.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ class AuthenticationBloc
8484
emit(AuthenticationFailure('Operation failed: ${e.message}'));
8585
} on HtHttpException catch (e) {
8686
// Catch any other HtHttpException subtypes
87-
emit(AuthenticationFailure('HTTP error: ${e.message}'));
87+
final message = e.message.isNotEmpty ? e.message : 'An unspecified HTTP error occurred.';
88+
emit(AuthenticationFailure('HTTP error: $message'));
8889
} catch (e) {
8990
// Catch any other unexpected errors
9091
emit(AuthenticationFailure('An unexpected error occurred: $e'));

0 commit comments

Comments
 (0)