Created
July 24, 2023 01:19
-
-
Save cdmunoz/b9c4b3f24f42e23b33092fd4a232e866 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