2005-06-13 Lluis Sanchez Gual <lluis@novell.com>
authorLluis Sanchez <lluis@novell.com>
Mon, 13 Jun 2005 14:44:51 +0000 (14:44 -0000)
committerLluis Sanchez <lluis@novell.com>
Mon, 13 Jun 2005 14:44:51 +0000 (14:44 -0000)
* RealProxy.cs: Report invalid return type of values using
InvalidCastException, like MS.NET. Fixes bug #75203.

svn path=/trunk/mcs/; revision=45876

mcs/class/corlib/System.Runtime.Remoting.Proxies/ChangeLog
mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs

index 4b85e5d84129487b9f8aa3206f2f3026cfcd3434..5ed994201a8da0a81b3bf8b739589bf94f7a59ea 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-13  Lluis Sanchez Gual  <lluis@novell.com>
+
+       * RealProxy.cs: Report invalid return type of values using
+       InvalidCastException, like MS.NET. Fixes bug #75203.
+
 2004-10-26  Lluis Sanchez Gual  <lluis@novell.com>
 
        * RealProxy.cs: Added _targetDomainId and _targetUri fields, which are
index c524d6877141626c95eb6229acee6cddc6263ad5..1ec073da99baeaad36bb4ba77c35c5f80e6a15ac 100644 (file)
@@ -286,7 +286,7 @@ namespace System.Runtime.Remoting.Proxies
 
                        MethodInfo mi = (MethodInfo) call.MethodBase;
                        if (mrm.ReturnValue != null && !mi.ReturnType.IsInstanceOfType (mrm.ReturnValue))
-                               throw new RemotingException ("Return value has an invalid type");
+                               throw new InvalidCastException ("Return value has an invalid type");
 
                        // Check out parameters
 
@@ -319,7 +319,7 @@ namespace System.Runtime.Remoting.Proxies
                                                object outArg = mrm.GetOutArg (nout++);
                                                if (outArg != null && !par.ParameterType.IsInstanceOfType (outArg))
                                                {
-                                                       throw new RemotingException ("Return argument '" + par.Name + "' has an invalid type");
+                                                       throw new InvalidCastException ("Return argument '" + par.Name + "' has an invalid type");
                                                }
                                                outArgs [narg++] = outArg;
                                        }