From 938b4f8bf84cac689538817263bfb3d79755c903 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 13 Jul 2011 01:19:12 +0100 Subject: if a SynchronousRestObjectRequester request fails, then unless it's due to a 404, log the exception for diagnostic purposes This is instead of logging "Invalid XML" for all failures, even if they weren't a result of invalid xml. A default TReponse is returned in the event of a 404, which is the same behaviour as previously. --- OpenSim/Framework/WebUtil.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index f33b7a2..87eeeb6 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -987,6 +987,17 @@ namespace OpenSim.Framework } } + catch (WebException e) + { + HttpWebResponse hwr = (HttpWebResponse)e.Response; + + if (hwr != null && hwr.StatusCode == HttpStatusCode.NotFound) + return deserial; + else + m_log.ErrorFormat( + "[SynchronousRestObjectRequester]: WebException {0} {1} {2} {3}", + requestUrl, typeof(TResponse).ToString(), e.Message, e.StackTrace); + } catch (System.InvalidOperationException) { // This is what happens when there is invalid XML -- cgit v1.1