fallback for serialization problems
authorAndrew Skiba <andrews@mono-cvs.ximian.com>
Tue, 7 Nov 2006 10:23:40 +0000 (10:23 -0000)
committerAndrew Skiba <andrews@mono-cvs.ximian.com>
Tue, 7 Nov 2006 10:23:40 +0000 (10:23 -0000)
svn path=/trunk/mcs/; revision=67442

mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/MyHost.jvm.cs

index 567a629453b327422ff5ccf4faea0f5b8447e832..b4239c63ae5312ea3e4c4dfe0434bb8d9e8651ca 100644 (file)
@@ -33,7 +33,16 @@ namespace MonoTests.SystemWeb.Framework
                                return string.Empty;
                        using (MemoryStream ms = new MemoryStream ()) {\r
                                SoapFormatter f = new SoapFormatter ();\r
-                               f.Serialize (ms, o);\r
+                               try {\r
+                                       f.Serialize (ms, o);\r
+                               }\r
+                               catch (Exception ex) {\r
+                                       Exception inner = o as Exception;\r
+                                       if (inner != null)\r
+                                               RethrowException (inner);\r
+                                       else\r
+                                               throw;\r
+                               }\r
                                return HttpUtility.UrlEncode (ms.ToArray());\r
                        }\r
                }