diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 2843e202be..94862a6372 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -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; } } } diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 79e49a11b9..3fdee9c8b4 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs @@ -303,9 +303,11 @@ namespace OpenSim.Services.Connectors.SimianGrid HttpWebResponse response = MultipartForm.Post(request, postParameters); 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) { @@ -317,12 +319,15 @@ namespace OpenSim.Services.Connectors.SimianGrid } else { - errorMessage = "Response format was invalid."; + errorMessage = "Response format was invalid:\n" + responseStr; } } - 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; } } }