diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 11 | ||||
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | 13 |
2 files changed, 17 insertions, 7 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 2843e20..94862a6 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -146,18 +146,23 @@ namespace OpenSim.Framework | |||
146 | { | 146 | { |
147 | using (Stream responseStream = response.GetResponseStream()) | 147 | using (Stream responseStream = response.GetResponseStream()) |
148 | { | 148 | { |
149 | string responseStr = null; | ||
150 | |||
149 | try | 151 | try |
150 | { | 152 | { |
151 | string responseStr = responseStream.GetStreamString(); | 153 | responseStr = responseStream.GetStreamString(); |
152 | OSD responseOSD = OSDParser.Deserialize(responseStr); | 154 | OSD responseOSD = OSDParser.Deserialize(responseStr); |
153 | if (responseOSD.Type == OSDType.Map) | 155 | if (responseOSD.Type == OSDType.Map) |
154 | return (OSDMap)responseOSD; | 156 | return (OSDMap)responseOSD; |
155 | else | 157 | else |
156 | errorMessage = "Response format was invalid."; | 158 | errorMessage = "Response format was invalid."; |
157 | } | 159 | } |
158 | catch | 160 | catch (Exception ex) |
159 | { | 161 | { |
160 | errorMessage = "Failed to parse the response."; | 162 | if (!String.IsNullOrEmpty(responseStr)) |
163 | errorMessage = "Failed to parse the response:\n" + responseStr; | ||
164 | else | ||
165 | errorMessage = "Failed to retrieve the response: " + ex.Message; | ||
161 | } | 166 | } |
162 | } | 167 | } |
163 | } | 168 | } |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 79e49a1..3fdee9c 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | |||
@@ -303,9 +303,11 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
303 | HttpWebResponse response = MultipartForm.Post(request, postParameters); | 303 | HttpWebResponse response = MultipartForm.Post(request, postParameters); |
304 | using (Stream responseStream = response.GetResponseStream()) | 304 | using (Stream responseStream = response.GetResponseStream()) |
305 | { | 305 | { |
306 | string responseStr = null; | ||
307 | |||
306 | try | 308 | try |
307 | { | 309 | { |
308 | string responseStr = responseStream.GetStreamString(); | 310 | responseStr = responseStream.GetStreamString(); |
309 | OSD responseOSD = OSDParser.Deserialize(responseStr); | 311 | OSD responseOSD = OSDParser.Deserialize(responseStr); |
310 | if (responseOSD.Type == OSDType.Map) | 312 | if (responseOSD.Type == OSDType.Map) |
311 | { | 313 | { |
@@ -317,12 +319,15 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
317 | } | 319 | } |
318 | else | 320 | else |
319 | { | 321 | { |
320 | errorMessage = "Response format was invalid."; | 322 | errorMessage = "Response format was invalid:\n" + responseStr; |
321 | } | 323 | } |
322 | } | 324 | } |
323 | catch | 325 | catch (Exception ex) |
324 | { | 326 | { |
325 | errorMessage = "Failed to parse the response."; | 327 | if (!String.IsNullOrEmpty(responseStr)) |
328 | errorMessage = "Failed to parse the response:\n" + responseStr; | ||
329 | else | ||
330 | errorMessage = "Failed to retrieve the response: " + ex.Message; | ||
326 | } | 331 | } |
327 | } | 332 | } |
328 | } | 333 | } |