chopper
chopper copied to clipboard
Modification of response in ResponseInterceptor throw error
I am using chopper 3.0.1.
class ResponseInterceptorImp extends ResponseInterceptor {
@override
FutureOr<Response> onResponse(Response response) {
return response.replace(bodyError: "Error occurred");
}
}
type Response<dynamic>
is not a subtype of type Response<BuiltList<Post>>
@Guldem was this fixed in #547?
Not sure what the issue is here. Looks like the replace
function doesn't apply the correct BodyType
.
Currently there is no replace
only copyWith
which works with this as far I know.
Other thing here is: Chopper doesn't allow modification of the request and response bodies in a interceptor., only in converters.
#547 Doesn't change any of these constraints currently.