Updated the error response body

This commit is contained in:
Abdullah Alassaf
2024-10-10 13:05:48 +03:00
parent 6efb6dd508
commit 5f1c4c5371
2 changed files with 3 additions and 3 deletions

View File

@ -31,8 +31,8 @@ class ServerFailure extends Failure {
{
// var document = parser.parse(dioError.response!.data.toString());
// var message = document.body!.text;
return ServerFailure.fromResponse(
dioError.response!.statusCode!, dioError.response?.data['message'] ?? "Error");
return ServerFailure.fromResponse(dioError.response!.statusCode!,
dioError.response?.data['error']['message'] ?? "Something went wrong");
}
case DioExceptionType.cancel:
return ServerFailure("The request to ApiServer was canceled");