diff options
| author | Jeroen Frijters <jeroen@sumatra.nl> | 2004-09-20 12:07:04 +0000 |
|---|---|---|
| committer | Jeroen Frijters <jeroen@sumatra.nl> | 2004-09-20 12:07:04 +0000 |
| commit | 39697d99bdd384a143c95bd1c39cb7bb80160f77 (patch) | |
| tree | 835566b3a324a8757a5b10f247ce124f6e1c27e6 /gnu/java/rmi/server/UnicastServerRef.java | |
| parent | d9ebf7280548173cdbe405f0147bddb5d9177a4b (diff) | |
| download | classpath-39697d99bdd384a143c95bd1c39cb7bb80160f77.tar.gz | |
2004-09-20 Ilya Perminov <iperminov@logicalsoft.com>
* gnu/java/rmi/server/UnicastServer.java
(incomingMessageCall): Added code to handle Errors.
* gnu/java/rmi/server/UnicastServerRef.java
(incomingMessageCall): Added code to handle Errors.
Diffstat (limited to 'gnu/java/rmi/server/UnicastServerRef.java')
| -rw-r--r-- | gnu/java/rmi/server/UnicastServerRef.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gnu/java/rmi/server/UnicastServerRef.java b/gnu/java/rmi/server/UnicastServerRef.java index 3e9529c59..1c5823a70 100644 --- a/gnu/java/rmi/server/UnicastServerRef.java +++ b/gnu/java/rmi/server/UnicastServerRef.java @@ -284,7 +284,16 @@ public Object incomingMessageCall(UnicastConnection conn, int method, long hash) try{ ret = meth.invoke(myself, args); }catch(InvocationTargetException e){ - throw (Exception)(e.getTargetException()); + Throwable cause = e.getTargetException(); + if (cause instanceof Exception) { + throw (Exception)cause; + } + else if (cause instanceof Error) { + throw (Error)cause; + } + else { + throw new Error("The remote method threw a java.lang.Throwable that is neither java.lang.Exception nor java.lang.Error.", e); + } } return ret; } |
