Created
July 24, 2023 01:20
-
-
Save cdmunoz/92b1be345505544541660f4e329b4e63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Response<T> buildFailureResponse<T>( | |
String message, { | |
int code = 400, | |
http.BaseRequest? request, | |
}) { | |
final body = jsonDecode(message) as Map<String, dynamic>; | |
final error = buildBackendError(statusCode: code, body: body); | |
return Response( | |
http.Response(message, code, request: request), | |
null, | |
error: error, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment