|
|
@ -86,13 +86,23 @@ public class SentinelProtectInterceptor implements ClientHttpRequestInterceptor
|
|
|
|
Tracer.trace(
|
|
|
|
Tracer.trace(
|
|
|
|
new IllegalStateException("RestTemplate ErrorHandler has error"));
|
|
|
|
new IllegalStateException("RestTemplate ErrorHandler has error"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return response;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Throwable e) {
|
|
|
|
catch (Throwable e) {
|
|
|
|
if (!BlockException.isBlockException(e)) {
|
|
|
|
if (BlockException.isBlockException(e)) {
|
|
|
|
Tracer.trace(e);
|
|
|
|
return handleBlockException(request, body, execution, (BlockException) e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
return handleBlockException(request, body, execution, (BlockException) e);
|
|
|
|
Tracer.trace(e);
|
|
|
|
|
|
|
|
if (e instanceof IOException) {
|
|
|
|
|
|
|
|
throw (IOException) e;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (e instanceof RuntimeException) {
|
|
|
|
|
|
|
|
throw (RuntimeException) e;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
throw new IOException(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
finally {
|
|
|
|
finally {
|
|
|
@ -103,7 +113,6 @@ public class SentinelProtectInterceptor implements ClientHttpRequestInterceptor
|
|
|
|
hostEntry.exit();
|
|
|
|
hostEntry.exit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return response;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private ClientHttpResponse handleBlockException(HttpRequest request, byte[] body,
|
|
|
|
private ClientHttpResponse handleBlockException(HttpRequest request, byte[] body,
|
|
|
|