File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
feign-reactor-webclient/src/main/java/reactivefeign/webclient Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 2222import reactivefeign .client .ReadTimeoutException ;
2323import reactor .netty .http .client .HttpClient ;
2424
25+ import java .util .Objects ;
2526import java .util .function .BiFunction ;
2627
2728import static reactivefeign .webclient .NettyClientHttpConnectorBuilder .buildNettyClientHttpConnector ;
@@ -78,13 +79,13 @@ protected ClientHttpConnector clientConnector() {
7879
7980 @ Override
8081 public BiFunction <ReactiveHttpRequest , Throwable , Throwable > errorMapper (){
81- return (request , throwable ) -> {
82- if (throwable instanceof WebClientRequestException
83- && throwable .getCause () instanceof io .netty .handler .timeout .ReadTimeoutException ){
82+ return Objects . requireNonNullElseGet ( this . errorMapper , () -> (request , throwable ) -> {
83+ if (throwable instanceof WebClientRequestException
84+ && throwable .getCause () instanceof io .netty .handler .timeout .ReadTimeoutException ) {
8485 return new ReadTimeoutException (throwable , request );
8586 }
8687 return null ;
87- };
88+ }) ;
8889 }
8990 }
9091
You can’t perform that action at this time.
0 commit comments