From ca9df4d2ef47691953d128d556b978e1cbb334db Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Fri, 11 Oct 2013 14:47:58 -0700 Subject: [PATCH] Return rather than throw converted http exception Fix HttpInvokerClientInterceptor.convertHttpInvokerAccessException to return the translated exception rather than throwing it. This brings the method implementation in line with the Java Doc and the obvious original intent. Issue: SPR-10965 --- .../httpinvoker/HttpInvokerClientInterceptor.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/remoting/httpinvoker/HttpInvokerClientInterceptor.java b/spring-web/src/main/java/org/springframework/remoting/httpinvoker/HttpInvokerClientInterceptor.java index ccc1f704f6..86ab131396 100644 --- a/spring-web/src/main/java/org/springframework/remoting/httpinvoker/HttpInvokerClientInterceptor.java +++ b/spring-web/src/main/java/org/springframework/remoting/httpinvoker/HttpInvokerClientInterceptor.java @@ -202,18 +202,18 @@ public class HttpInvokerClientInterceptor extends RemoteInvocationBasedAccessor */ protected RemoteAccessException convertHttpInvokerAccessException(Throwable ex) { if (ex instanceof ConnectException) { - throw new RemoteConnectFailureException( + return new RemoteConnectFailureException( "Could not connect to HTTP invoker remote service at [" + getServiceUrl() + "]", ex); } - else if (ex instanceof ClassNotFoundException || ex instanceof NoClassDefFoundError || + + if (ex instanceof ClassNotFoundException || ex instanceof NoClassDefFoundError || ex instanceof InvalidClassException) { - throw new RemoteAccessException( + return new RemoteAccessException( "Could not deserialize result from HTTP invoker remote service [" + getServiceUrl() + "]", ex); } - else { - throw new RemoteAccessException( - "Could not access HTTP invoker remote service at [" + getServiceUrl() + "]", ex); - } + + return new RemoteAccessException( + "Could not access HTTP invoker remote service at [" + getServiceUrl() + "]", ex); } }