aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/WebUtil.cs25
1 files changed, 19 insertions, 6 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index bc2cd01..2fd31d8 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -918,6 +918,10 @@ namespace OpenSim.Framework
918 918
919 public class SynchronousRestObjectRequester 919 public class SynchronousRestObjectRequester
920 { 920 {
921 private static readonly ILog m_log =
922 LogManager.GetLogger(
923 MethodBase.GetCurrentMethod().DeclaringType);
924
921 /// <summary> 925 /// <summary>
922 /// Perform a synchronous REST request. 926 /// Perform a synchronous REST request.
923 /// </summary> 927 /// </summary>
@@ -972,9 +976,9 @@ namespace OpenSim.Framework
972 } 976 }
973 } 977 }
974 978
975 try 979 using (WebResponse resp = request.GetResponse())
976 { 980 {
977 using (WebResponse resp = request.GetResponse()) 981 try
978 { 982 {
979 if (resp.ContentLength > 0) 983 if (resp.ContentLength > 0)
980 { 984 {
@@ -984,10 +988,19 @@ namespace OpenSim.Framework
984 respStream.Close(); 988 respStream.Close();
985 } 989 }
986 } 990 }
987 } 991 catch (System.InvalidOperationException)
988 catch (System.InvalidOperationException) 992 {
989 { 993 // This is what happens when there is invalid XML
990 // This is what happens when there is invalid XML 994 try
995 {
996 m_log.WarnFormat("[SynchronousRestObjectRequester]: Invalid XML:");
997 using (StreamReader sr = new StreamReader(resp.GetResponseStream()))
998 m_log.WarnFormat("{0}", sr.ReadToEnd());
999 }
1000 catch (Exception e)
1001 { }
1002
1003 }
991 } 1004 }
992 return deserial; 1005 return deserial;
993 } 1006 }