- public static GraphApiException create(ClientResponse response)
+ public static Mono<GraphApiException> create(ClientResponse response)
{
HttpStatus status = response.statusCode();
HttpHeaders headers = response.headers().asHttpHeaders();
- Mono<String> body = response.bodyToMono(String.class);
- return create(status , headers, body.block().getBytes());
+ return
+ response
+ .bodyToMono(InputStream.class)
+ .map(is -> create(status , headers, is));
}
public static GraphApiException create(
.filter((request, next) -> next.exchange(request).flatMap(response ->
{
List<String> headerValues = response.headers().header("Foo");
- return headerValues.isEmpty() ? Mono.error(GraphApiException.create(response)) :
+ return headerValues.isEmpty() ? Mono.error(GraphApiException.create(response).block()) :
Mono.just(response);
}))
.build();