aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications')
-rw-r--r--OpenSim/Framework/Communications/RestClient.cs26
1 files changed, 24 insertions, 2 deletions
diff --git a/OpenSim/Framework/Communications/RestClient.cs b/OpenSim/Framework/Communications/RestClient.cs
index 3035da5..db5010b 100644
--- a/OpenSim/Framework/Communications/RestClient.cs
+++ b/OpenSim/Framework/Communications/RestClient.cs
@@ -165,7 +165,18 @@ namespace OpenSim.Framework.Communications
165 /// <param name="value">Value of the parameter, e.g. 42</param> 165 /// <param name="value">Value of the parameter, e.g. 42</param>
166 public void AddQueryParameter(string name, string value) 166 public void AddQueryParameter(string name, string value)
167 { 167 {
168 _parameterElements.Add(HttpUtility.UrlEncode(name), HttpUtility.UrlEncode(value)); 168 try
169 {
170 _parameterElements.Add(HttpUtility.UrlEncode(name), HttpUtility.UrlEncode(value));
171 }
172 catch (ArgumentException)
173 {
174 m_log.Error("[REST]: Query parameter " + name + " is already added.");
175 }
176 catch (Exception e)
177 {
178 m_log.Error("[REST]: An exception was raised adding query parameter to dictionary. Exception: {0}",e);
179 }
169 } 180 }
170 181
171 /// <summary> 182 /// <summary>
@@ -174,7 +185,18 @@ namespace OpenSim.Framework.Communications
174 /// <param name="name">Name of the parameter, e.g. min</param> 185 /// <param name="name">Name of the parameter, e.g. min</param>
175 public void AddQueryParameter(string name) 186 public void AddQueryParameter(string name)
176 { 187 {
177 _parameterElements.Add(HttpUtility.UrlEncode(name), null); 188 try
189 {
190 _parameterElements.Add(HttpUtility.UrlEncode(name), null);
191 }
192 catch (ArgumentException)
193 {
194 m_log.Error("[REST]: Query parameter " + name + " is already added.");
195 }
196 catch (Exception e)
197 {
198 m_log.Error("[REST]: An exception was raised adding query parameter to dictionary. Exception: {0}",e);
199 }
178 } 200 }
179 201
180 /// <summary> 202 /// <summary>