internalError method
Return INTERNAL_SERVER_ERROR Response (status_code 500) with T instance serialized from json created from class
Implementation
FutureOr<Response> internalError(
FutureOr<T> object, {
Map<String, Object>? optionalHeaders,
}) async {
final json = (await object).toJson();
final headers = (optionalHeaders ?? <String, Object>{});
headers.addAll(_jsonContentType);
final response = Response.internalServerError(
body: jsonEncode(json),
headers: headers,
);
return response;
}