Skip to content
Permalink
Browse files
Improve information captured in UnknownException
  • Loading branch information
ngmr committed Apr 17, 2015
1 parent 5b8f2a3 commit c11f3a856a0740e046e0964fbcf8d0a2c8afb657
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 19 deletions.
@@ -84,7 +84,7 @@ else if (name.equals("type"))

} catch (InvocationTargetException ex) {
throw new RuntimeException(
"cannot initialize: " + ex, ex);
"cannot initialize: " + ex.getCause(), ex.getCause());

} catch (IllegalAccessException ex) {
throw new RuntimeException(
@@ -143,7 +143,7 @@ public Object readValue(org.omg.CORBA.portable.InputStream in) {
try {
return _read_method.invoke(null, new Object[] { in });
} catch (InvocationTargetException ex) {
throw (org.omg.CORBA.MARSHAL)new org.omg.CORBA.MARSHAL(ex.getMessage()).initCause(ex);
throw (org.omg.CORBA.MARSHAL)new org.omg.CORBA.MARSHAL(""+ex.getCause()).initCause(ex.getCause());
} catch (IllegalAccessException ex) {
throw (org.omg.CORBA.MARSHAL)new org.omg.CORBA.MARSHAL(ex.getMessage()).initCause(ex);
}
@@ -178,7 +178,7 @@ public void writeValue(org.omg.CORBA.portable.OutputStream out, java.io.Serializ
try {
_write_method.invoke(null, new Object[] { out, val });
} catch (InvocationTargetException ex) {
throw (org.omg.CORBA.MARSHAL)new org.omg.CORBA.MARSHAL(ex.getMessage()).initCause(ex);
throw (org.omg.CORBA.MARSHAL)new org.omg.CORBA.MARSHAL(""+ ex.getCause()).initCause(ex.getCause());
} catch (IllegalAccessException ex) {
throw (org.omg.CORBA.MARSHAL)new org.omg.CORBA.MARSHAL(ex.getMessage()).initCause(ex);
}
@@ -191,7 +191,7 @@ org.omg.CORBA.TypeCode getTypeCode() {
_type_code = (org.omg.CORBA.TypeCode) _type_method.invoke(null,
new Object[0]);
} catch (InvocationTargetException ex) {
throw (org.omg.CORBA.MARSHAL)new org.omg.CORBA.MARSHAL(ex.getMessage()).initCause(ex);
throw (org.omg.CORBA.MARSHAL)new org.omg.CORBA.MARSHAL(""+ex.getCause()).initCause(ex.getCause());
} catch (IllegalAccessException ex) {
throw (org.omg.CORBA.MARSHAL)new org.omg.CORBA.MARSHAL(ex.getMessage()).initCause(ex);
}
@@ -284,7 +284,7 @@ static javax.rmi.CORBA.Stub createRMIStub(RMIState state, Class type)
"internal problem: cannot instantiate stub", ex);
} catch (InvocationTargetException ex) {
throw new RuntimeException(
"internal problem: cannot instantiate stub", ex);
"internal problem: cannot instantiate stub", ex.getCause());
} catch (IllegalAccessException ex) {
throw new RuntimeException(
"internal problem: cannot instantiate stub", ex);
@@ -127,7 +127,7 @@ Object invoke_method(java.lang.reflect.Method m, Object[] args)
try {
return m.invoke(_target, args);
} catch (java.lang.reflect.InvocationTargetException ex) {
logger.log(Level.FINER, "Error invoking local method", ex);
logger.log(Level.FINER, "Error invoking local method", ex.getCause());
throw ex.getTargetException();
}
} else {
@@ -266,7 +266,7 @@ public Stub getStaticStub(String codebase, Class type) {
+ ex.getMessage(), ex);
} catch (InvocationTargetException ex) {
logger.log(Level.FINE, "cannot instantiate stub class for " + type + " :: "
+ ex.getMessage(), ex);
+ ex.getCause(), ex.getCause());
}

return null;
@@ -43,6 +43,7 @@
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.ValueMember;
import org.omg.CORBA.ValueDefPackage.FullValueDescription;
import org.omg.CORBA.portable.UnknownException;
import org.omg.SendingContext.CodeBase;
import org.omg.SendingContext.CodeBaseHelper;

@@ -521,8 +522,8 @@ public java.io.Serializable writeReplace(java.io.Serializable val) {
throw (MARSHAL)new MARSHAL(ex.getMessage()).initCause(ex);

} catch (InvocationTargetException ex) {
throw new org.omg.CORBA.portable.UnknownException(ex
.getTargetException());
throw (UnknownException)new UnknownException(ex
.getTargetException()).initCause(ex.getTargetException());
}

}
@@ -543,8 +544,8 @@ public java.io.Serializable readResolve(java.io.Serializable val) {
throw (MARSHAL)new MARSHAL(ex.getMessage()).initCause(ex);

} catch (InvocationTargetException ex) {
throw new org.omg.CORBA.portable.UnknownException(ex
.getTargetException());
throw (UnknownException)new UnknownException(ex
.getTargetException()).initCause(ex.getTargetException());
}

}
@@ -615,8 +616,8 @@ protected void writeValue(ObjectWriter writer, java.io.Serializable val)

} catch (InvocationTargetException ex) {

throw new org.omg.CORBA.portable.UnknownException(ex
.getTargetException());
throw (UnknownException)new UnknownException(ex
.getTargetException()).initCause(ex.getTargetException());
}

} else {
@@ -642,8 +643,8 @@ public java.io.Serializable createBlankInstance() {
throw (MARSHAL)new MARSHAL(ex.getMessage()).initCause(ex);

} catch (InvocationTargetException ex) {
throw new org.omg.CORBA.portable.UnknownException(ex
.getTargetException());
throw (UnknownException)new UnknownException(ex
.getTargetException()).initCause(ex.getTargetException());

} catch (NullPointerException ex) {
logger.log(Level.WARNING,
@@ -859,8 +860,8 @@ protected void readValue(ObjectReader reader, java.io.Serializable value)
} catch (IllegalArgumentException ex) {
throw (MARSHAL)new MARSHAL(ex.getMessage()).initCause(ex);
} catch (InvocationTargetException ex) {
throw new org.omg.CORBA.portable.UnknownException(ex
.getTargetException());
throw (UnknownException)new UnknownException(ex
.getTargetException()).initCause(ex.getTargetException());
}

} else {
@@ -246,7 +246,7 @@ public Object run() {
} catch (InstantiationException ex) {
logger.log(Level.WARNING, "", ex);
} catch (InvocationTargetException ex) {
logger.log(Level.WARNING, "", ex);
logger.log(Level.WARNING, "", ex.getCause());
} catch (IllegalAccessException ex) {
logger.log(Level.WARNING, "", ex);
}
@@ -21,7 +21,7 @@ public class UnknownException extends org.omg.CORBA.SystemException {
public Throwable originalEx;

public UnknownException(Throwable ex) {
super("", 0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
super("originalEx: " + ex, 0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
originalEx = ex;
}
}

0 comments on commit c11f3a8

Please sign in to comment.