* Better error logging for failed SimianGrid web service calls

This commit is contained in:
John Hurliman
2010-04-22 18:55:31 -07:00
parent a7449a82bc
commit 67990ea7e4
2 changed files with 17 additions and 7 deletions

View File

@@ -146,18 +146,23 @@ namespace OpenSim.Framework
{
using (Stream responseStream = response.GetResponseStream())
{
string responseStr = null;
try
{
string responseStr = responseStream.GetStreamString();
responseStr = responseStream.GetStreamString();
OSD responseOSD = OSDParser.Deserialize(responseStr);
if (responseOSD.Type == OSDType.Map)
return (OSDMap)responseOSD;
else
errorMessage = "Response format was invalid.";
}
catch
catch (Exception ex)
{
errorMessage = "Failed to parse the response.";
if (!String.IsNullOrEmpty(responseStr))
errorMessage = "Failed to parse the response:\n" + responseStr;
else
errorMessage = "Failed to retrieve the response: " + ex.Message;
}
}
}