mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00
Refactor ServerFailure class to use 'message' field from response
Update ServerFailure class to extract error message from 'message' field in response data instead of converting the entire data to a string.
This commit is contained in:
@ -32,7 +32,7 @@ class ServerFailure extends Failure {
|
|||||||
// var document = parser.parse(dioError.response!.data.toString());
|
// var document = parser.parse(dioError.response!.data.toString());
|
||||||
// var message = document.body!.text;
|
// var message = document.body!.text;
|
||||||
return ServerFailure.fromResponse(
|
return ServerFailure.fromResponse(
|
||||||
dioError.response!.statusCode!, dioError.response!.data.toString()
|
dioError.response!.statusCode!, dioError.response!.data['message']
|
||||||
// message
|
// message
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user