Refactor error handling in AuthCubit and ServerFailure

Update error handling in AuthCubit to use toString() method and mdified
handling of badResponse in ServerFailure class.
This commit is contained in:
Mohammad Salameh
2024-03-19 15:13:00 +03:00
parent cb913cd784
commit d4a9cfb7ab
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ class AuthCubit extends Cubit<AuthState> {
emit(AuthError('Something went wrong'));
}
} on DioException catch (e) {
emit(AuthError(ServerFailure.fromDioError(e).errMessage));
emit(AuthError(ServerFailure.fromDioError(e).toString()));
}
}