Remove ClientException check for TraceFeignBlockingLoadBalancerClient and TraceRetryableFeignBlockingLoadBalancerClient (#1842)

* Remove ClientException check for TraceFeignBlockingLoadBalancerClient and TraceRetryableFeignBlockingLoadBalancerClient. Fixes gh-1838.

* Trigger Build
This commit is contained in:
Olga Maciaszek-Sharma
2021-02-08 15:40:14 +01:00
committed by GitHub
parent f2d2109f8c
commit b3c038b427
2 changed files with 4 additions and 12 deletions

View File

@@ -21,7 +21,6 @@ import java.io.IOException;
import brave.Span;
import brave.Tracer;
import brave.http.HttpTracing;
import com.netflix.client.ClientException;
import feign.Client;
import feign.Request;
import feign.Response;
@@ -83,13 +82,10 @@ public class TraceFeignBlockingLoadBalancerClient
if (LOG.isDebugEnabled()) {
LOG.debug("Exception thrown", e);
}
if (e instanceof IOException || e.getCause() != null
&& e.getCause() instanceof ClientException
&& ((ClientException) e.getCause())
.getErrorType() == ClientException.ErrorType.GENERAL) {
if (e instanceof IOException) {
if (LOG.isDebugEnabled()) {
LOG.debug(
"General exception was thrown, so most likely the traced client wasn't called. Falling back to a manual span");
"IO exception was thrown, so most likely the traced client wasn't called. Falling back to a manual span");
}
tracingFeignClient().handleSendAndReceive(fallbackSpan, request, response,
e);

View File

@@ -21,7 +21,6 @@ import java.io.IOException;
import brave.Span;
import brave.Tracer;
import brave.http.HttpTracing;
import com.netflix.client.ClientException;
import feign.Client;
import feign.Request;
import feign.Response;
@@ -80,13 +79,10 @@ class TraceRetryableFeignBlockingLoadBalancerClient
if (LOG.isDebugEnabled()) {
LOG.debug("Exception thrown", e);
}
if (e instanceof IOException || e.getCause() != null
&& e.getCause() instanceof ClientException
&& ((ClientException) e.getCause())
.getErrorType() == ClientException.ErrorType.GENERAL) {
if (e instanceof IOException) {
if (LOG.isDebugEnabled()) {
LOG.debug(
"General exception was thrown, so most likely the traced client wasn't called. Falling back to a manual span");
"IO exception was thrown, so most likely the traced client wasn't called. Falling back to a manual span");
}
tracingFeignClient().handleSendAndReceive(fallbackSpan, request, response,
e);