Permalink
Browse files

#3783 wrapped RServi exception with full URI info when health check f…

…ails
  • Loading branch information...
1 parent 5ee45d5 commit 3d27266be48c346993b69be8f0002da17799d233 @ddossot ddossot committed Oct 5, 2013
Showing with 14 additions and 5 deletions.
  1. +14 −5 src/main/java/eu/openanalytics/rsb/component/SystemHealthResource.java
@@ -25,6 +25,7 @@
import java.lang.management.OperatingSystemMXBean;
import java.lang.management.RuntimeMXBean;
import java.net.URI;
+import java.rmi.ConnectException;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
@@ -42,7 +43,6 @@
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.time.DurationFormatUtils;
-import org.eclipse.core.runtime.CoreException;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@@ -166,11 +166,20 @@ private void verifyRServiConnectivity() throws Exception
}
}
- private void verifyRServiConnectivity(final URI rServiUri) throws Exception, CoreException
+ private void verifyRServiConnectivity(final URI rServiUri) throws Exception
{
- // never use pooled clients to check connectivity
- final RServi rServi = rServiInstanceProvider.getRServiInstance(rServiUri.toString(),
- Constants.RSERVI_CLIENT_ID, PoolingStrategy.NEVER);
+ RServi rServi = null;
+
+ try
+ {
+ // never use pooled clients to check connectivity
+ rServi = rServiInstanceProvider.getRServiInstance(rServiUri.toString(),
+ Constants.RSERVI_CLIENT_ID, PoolingStrategy.NEVER);
+ }
+ catch (final Exception e)
+ {
+ throw new ConnectException("Failed to retrieve an RServi instance at URI: " + rServiUri, e);
+ }
try
{

0 comments on commit 3d27266

Please sign in to comment.