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.
bulletsim
Justin Clark-Casey (justincc) 2011-07-13 01:19:12 +01:00
parent e434ba5e8e
commit 938b4f8bf8
1 changed files with 11 additions and 0 deletions

View File

@ -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