public static GraphApiException create(ClientResponse response)
{
return
- response.body((ReactiveHttpInputMessage message, Context context) ->
- {
- DataBuffer buffer = message.getBody().blockFirst();
- InputStream is = message.getBody().blockFirst().asInputStream();
- return create(response.statusCode(), message.getHeaders(), is);
- });
+ response
+ .body((ReactiveHttpInputMessage message, Context context) ->
+ message
+ .getBody()
+ .map(buffer -> buffer.asInputStream()))
+ .flatMap(is -> create(response.statusCode(), message.getHeaders(), is));
}
public static GraphApiException create(