dain 2005/03/28 20:19:07
Modified: modules/core/src/java/org/openejb/corba/util
UtilDelegateImpl.java
Log:
Nest original exception when mapping from a corba exception to a rmi exception
Revision Changes Path
1.9 +17 -9
openejb/modules/core/src/java/org/openejb/corba/util/UtilDelegateImpl.java
Index: UtilDelegateImpl.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/util/UtilDelegateImpl.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- UtilDelegateImpl.java 27 Mar 2005 02:04:42 -0000 1.8
+++ UtilDelegateImpl.java 29 Mar 2005 01:19:07 -0000 1.9
@@ -160,25 +160,33 @@
public RemoteException mapSystemException(SystemException ex) {
if (ex instanceof TRANSACTION_ROLLEDBACK) {
- return new TransactionRolledbackException(ex.getMessage());
+ TransactionRolledbackException transactionRolledbackException =
new TransactionRolledbackException(ex.getMessage());
+ transactionRolledbackException.detail = ex;
+ return transactionRolledbackException;
}
if (ex instanceof TRANSACTION_REQUIRED) {
- return new TransactionRequiredException(ex.getMessage());
+ TransactionRequiredException transactionRequiredException = new
TransactionRequiredException(ex.getMessage());
+ transactionRequiredException.detail = ex;
+ return transactionRequiredException;
}
if (ex instanceof INVALID_TRANSACTION) {
- return new InvalidTransactionException(ex.getMessage());
+ InvalidTransactionException invalidTransactionException = new
InvalidTransactionException(ex.getMessage());
+ invalidTransactionException.detail = ex;
+ return invalidTransactionException;
}
if (ex instanceof OBJECT_NOT_EXIST) {
- return new NoSuchObjectException(ex.getMessage());
+ NoSuchObjectException noSuchObjectException = new
NoSuchObjectException(ex.getMessage());
+ noSuchObjectException.detail = ex;
+ return noSuchObjectException;
}
if (ex instanceof NO_PERMISSION) {
- return new AccessException(ex.getMessage());
+ return new AccessException(ex.getMessage(), ex);
}
if (ex instanceof MARSHAL) {
- return new MarshalException(ex.getMessage());
+ return new MarshalException(ex.getMessage(), ex);
}
if (ex instanceof UNKNOWN) {
- return new RemoteException(ex.getMessage());
+ return new RemoteException(ex.getMessage(), ex);
}
return delegate.mapSystemException(ex);
}