diff options
author | Justin Clark-Casey (justincc) | 2010-04-23 19:05:32 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-04-23 19:05:32 +0100 |
commit | 5ee77886acde5292a7a527866539e7e05d63e344 (patch) | |
tree | 157df3af3bd0175bc73493688c9742312c4d7176 /OpenSim/Framework/WebUtil.cs | |
parent | Change SQLiteNG to work with mono 2.6 and above using the Mono.Data.Sqlite.dll (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-5ee77886acde5292a7a527866539e7e05d63e344.zip opensim-SC-5ee77886acde5292a7a527866539e7e05d63e344.tar.gz opensim-SC-5ee77886acde5292a7a527866539e7e05d63e344.tar.bz2 opensim-SC-5ee77886acde5292a7a527866539e7e05d63e344.tar.xz |
Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Framework/WebUtil.cs')
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 11 |
1 files changed, 8 insertions, 3 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 | } |