More error messages to warn when/if things go wrong.

prioritization
Diva Canto 2009-10-05 09:18:51 -07:00
parent ad81b453b3
commit 75b35ddf4a
1 changed files with 14 additions and 2 deletions

View File

@ -28,14 +28,21 @@
using System; using System;
using System.IO; using System.IO;
using System.Net; using System.Net;
using System.Reflection;
using System.Text; using System.Text;
using System.Xml; using System.Xml;
using System.Xml.Serialization; using System.Xml.Serialization;
using log4net;
namespace OpenSim.Framework.Servers.HttpServer namespace OpenSim.Framework.Servers.HttpServer
{ {
public class SynchronousRestFormsRequester public class SynchronousRestFormsRequester
{ {
private static readonly ILog m_log =
LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// Perform a synchronous REST request. /// Perform a synchronous REST request.
/// </summary> /// </summary>
@ -72,8 +79,9 @@ namespace OpenSim.Framework.Servers.HttpServer
requestStream = request.GetRequestStream(); requestStream = request.GetRequestStream();
requestStream.Write(buffer.ToArray(), 0, length); requestStream.Write(buffer.ToArray(), 0, length);
} }
catch catch (Exception e)
{ {
m_log.DebugFormat("[FORMS]: exception occured on sending request {0}", e.Message);
} }
finally finally
{ {
@ -102,7 +110,10 @@ namespace OpenSim.Framework.Servers.HttpServer
respstring = reader.ReadToEnd(); respstring = reader.ReadToEnd();
} }
} }
catch { } catch (Exception e)
{
m_log.DebugFormat("[FORMS]: exception occured on receiving reply {0}", e.Message);
}
finally finally
{ {
if (respStream != null) if (respStream != null)
@ -114,6 +125,7 @@ namespace OpenSim.Framework.Servers.HttpServer
catch (System.InvalidOperationException) catch (System.InvalidOperationException)
{ {
// This is what happens when there is invalid XML // This is what happens when there is invalid XML
m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving request");
} }
return respstring; return respstring;
} }