|
|
|
@ -42,6 +42,7 @@ import org.springframework.util.StreamUtils; |
|
|
|
* Created via the {@link ReactorNettyClientRequestFactory}. |
|
|
|
* Created via the {@link ReactorNettyClientRequestFactory}. |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Arjen Poutsma |
|
|
|
* @author Arjen Poutsma |
|
|
|
|
|
|
|
* @author Juergen Hoeller |
|
|
|
* @since 6.1 |
|
|
|
* @since 6.1 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
final class ReactorNettyClientRequest extends AbstractStreamingClientHttpRequest { |
|
|
|
final class ReactorNettyClientRequest extends AbstractStreamingClientHttpRequest { |
|
|
|
@ -101,18 +102,8 @@ final class ReactorNettyClientRequest extends AbstractStreamingClientHttpRequest |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
catch (RuntimeException ex) { // Exceptions.ReactiveException is package private
|
|
|
|
catch (RuntimeException ex) { |
|
|
|
Throwable cause = ex.getCause(); |
|
|
|
throw convertException(ex); |
|
|
|
|
|
|
|
|
|
|
|
if (cause instanceof UncheckedIOException uioEx) { |
|
|
|
|
|
|
|
throw uioEx.getCause(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (cause instanceof IOException ioEx) { |
|
|
|
|
|
|
|
throw ioEx; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
throw new IOException(ex.getMessage(), cause); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -136,6 +127,21 @@ final class ReactorNettyClientRequest extends AbstractStreamingClientHttpRequest |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static IOException convertException(RuntimeException ex) { |
|
|
|
|
|
|
|
// Exceptions.ReactiveException is package private
|
|
|
|
|
|
|
|
Throwable cause = ex.getCause(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (cause instanceof UncheckedIOException uioEx) { |
|
|
|
|
|
|
|
return uioEx.getCause(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (cause instanceof IOException ioEx) { |
|
|
|
|
|
|
|
return ioEx; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
return new IOException(ex.getMessage(), cause); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final class ByteBufMapper implements OutputStreamPublisher.ByteMapper<ByteBuf> { |
|
|
|
private static final class ByteBufMapper implements OutputStreamPublisher.ByteMapper<ByteBuf> { |
|
|
|
|
|
|
|
|
|
|
|
|