summaryrefslogtreecommitdiff
path: root/java/src/IceBox/ServiceManagerI.java
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2011-03-30 10:51:07 -0700
committerMark Spruiell <mes@zeroc.com>2011-03-30 10:51:07 -0700
commitc28875d4c01935919396999852cb1c3f92c0fdbc (patch)
tree12f6b1cefe57d572121dcb47bd22b2f65dc3edff /java/src/IceBox/ServiceManagerI.java
parent4986 - add constructor that takes Throwable (diff)
downloadice-c28875d4c01935919396999852cb1c3f92c0fdbc.tar.bz2
ice-c28875d4c01935919396999852cb1c3f92c0fdbc.tar.xz
ice-c28875d4c01935919396999852cb1c3f92c0fdbc.zip
4987 - preserve exception cause
Diffstat (limited to 'java/src/IceBox/ServiceManagerI.java')
-rw-r--r--java/src/IceBox/ServiceManagerI.java32
1 files changed, 9 insertions, 23 deletions
diff --git a/java/src/IceBox/ServiceManagerI.java b/java/src/IceBox/ServiceManagerI.java
index e9dc102d282..b1919dcc505 100644
--- a/java/src/IceBox/ServiceManagerI.java
+++ b/java/src/IceBox/ServiceManagerI.java
@@ -502,10 +502,8 @@ public class ServiceManagerI extends _ServiceManagerDisp
}
catch(IllegalAccessException ex)
{
- FailureException e = new FailureException();
- e.reason = "ServiceManager: unable to access service constructor " + className + "(Ice.Communicator)";
- e.initCause(ex);
- throw e;
+ throw new FailureException(
+ "ServiceManager: unable to access service constructor " + className + "(Ice.Communicator)", ex);
}
catch(NoSuchMethodException ex)
{
@@ -513,10 +511,8 @@ public class ServiceManagerI extends _ServiceManagerDisp
}
catch(java.lang.reflect.InvocationTargetException ex)
{
- FailureException e = new FailureException();
- e.reason = "ServiceManager: service constructor " + className + "(Ice.Communicator) threw an exception";
- e.initCause(ex.getCause());
- throw e;
+ throw new FailureException(
+ "ServiceManager: service constructor " + className + "(Ice.Communicator) threw an exception", ex);
}
if(obj == null)
@@ -530,10 +526,8 @@ public class ServiceManagerI extends _ServiceManagerDisp
}
catch(IllegalAccessException ex)
{
- FailureException e = new FailureException();
- e.reason = "ServiceManager: unable to access default service constructor in class " + className;
- e.initCause(ex);
- throw e;
+ throw new FailureException(
+ "ServiceManager: unable to access default service constructor in class " + className, ex);
}
}
@@ -543,17 +537,12 @@ public class ServiceManagerI extends _ServiceManagerDisp
}
catch(ClassCastException ex)
{
- FailureException e = new FailureException();
- e.reason = "ServiceManager: class " + className + " does not implement IceBox.Service";
- throw e;
+ throw new FailureException("ServiceManager: class " + className + " does not implement IceBox.Service");
}
}
catch(InstantiationException ex)
{
- FailureException e = new FailureException();
- e.reason = "ServiceManager: unable to instantiate class " + className;
- e.initCause(ex);
- throw e;
+ throw new FailureException("ServiceManager: unable to instantiate class " + className, ex);
}
//
@@ -675,10 +664,7 @@ public class ServiceManagerI extends _ServiceManagerDisp
}
catch(Throwable ex)
{
- FailureException e = new FailureException();
- e.reason = "ServiceManager: exception while starting service " + service + ": " + ex;
- e.initCause(ex);
- throw e;
+ throw new FailureException("ServiceManager: exception while starting service " + service + ": " + ex, ex);
}
}