mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 09:45:22 +00:00
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:
@ -28,8 +28,8 @@ class ServerFailure extends Failure {
|
||||
return ServerFailure("Bad certificate!");
|
||||
|
||||
case DioExceptionType.badResponse:
|
||||
return ServerFailure.fromResponse(
|
||||
dioError.response!.statusCode!, dioError.response!.data);
|
||||
return ServerFailure.fromResponse(dioError.response!.statusCode!,
|
||||
dioError.response!.data!["message"]);
|
||||
case DioExceptionType.cancel:
|
||||
return ServerFailure("The request to ApiServer was canceled");
|
||||
|
||||
|
Reference in New Issue
Block a user