Merge pull request #2146 from theonefx/master

throw exception directly when exception is not an BlockException
pull/2147/head
TheoneFx 4 years ago committed by GitHub
commit 9d9c0a5306
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save