aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Grid
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-02-07 21:40:28 +0000
committerJustin Clark-Casey (justincc)2012-02-07 21:40:28 +0000
commit1f402fdf5e8ef53a07f98c4447946805791d26bc (patch)
treed7a0ea0ee0538e0a14bb69dd2e76cf9ac43e34b5 /OpenSim/Services/Connectors/Grid
parentAdd TestAddTaskInventoryItem() (diff)
downloadopensim-SC_OLD-1f402fdf5e8ef53a07f98c4447946805791d26bc.zip
opensim-SC_OLD-1f402fdf5e8ef53a07f98c4447946805791d26bc.tar.gz
opensim-SC_OLD-1f402fdf5e8ef53a07f98c4447946805791d26bc.tar.bz2
opensim-SC_OLD-1f402fdf5e8ef53a07f98c4447946805791d26bc.tar.xz
Add url to logging if SynchronousRestFormsRequester.MakRequest() throws an exception in service connectors
Diffstat (limited to 'OpenSim/Services/Connectors/Grid')
-rw-r--r--OpenSim/Services/Connectors/Grid/GridServiceConnector.cs72
1 files changed, 40 insertions, 32 deletions
diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
index e57f28b..1599a56 100644
--- a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
@@ -98,12 +98,11 @@ namespace OpenSim.Services.Connectors
98 sendData["METHOD"] = "register"; 98 sendData["METHOD"] = "register";
99 99
100 string reqString = ServerUtils.BuildQueryString(sendData); 100 string reqString = ServerUtils.BuildQueryString(sendData);
101 string uri = m_ServerURI + "/grid";
101 // m_log.DebugFormat("[GRID CONNECTOR]: queryString = {0}", reqString); 102 // m_log.DebugFormat("[GRID CONNECTOR]: queryString = {0}", reqString);
102 try 103 try
103 { 104 {
104 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 105 string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
105 m_ServerURI + "/grid",
106 reqString);
107 if (reply != string.Empty) 106 if (reply != string.Empty)
108 { 107 {
109 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 108 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
@@ -133,7 +132,7 @@ namespace OpenSim.Services.Connectors
133 } 132 }
134 catch (Exception e) 133 catch (Exception e)
135 { 134 {
136 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 135 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
137 } 136 }
138 137
139 return "Error communicating with grid service"; 138 return "Error communicating with grid service";
@@ -147,11 +146,12 @@ namespace OpenSim.Services.Connectors
147 146
148 sendData["METHOD"] = "deregister"; 147 sendData["METHOD"] = "deregister";
149 148
149 string uri = m_ServerURI + "/grid";
150
150 try 151 try
151 { 152 {
152 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 153 string reply
153 m_ServerURI + "/grid", 154 = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData));
154 ServerUtils.BuildQueryString(sendData));
155 155
156 if (reply != string.Empty) 156 if (reply != string.Empty)
157 { 157 {
@@ -165,7 +165,7 @@ namespace OpenSim.Services.Connectors
165 } 165 }
166 catch (Exception e) 166 catch (Exception e)
167 { 167 {
168 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 168 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
169 } 169 }
170 170
171 return false; 171 return false;
@@ -184,15 +184,15 @@ namespace OpenSim.Services.Connectors
184 184
185 string reqString = ServerUtils.BuildQueryString(sendData); 185 string reqString = ServerUtils.BuildQueryString(sendData);
186 string reply = string.Empty; 186 string reply = string.Empty;
187 string uri = m_ServerURI + "/grid";
188
187 try 189 try
188 { 190 {
189 reply = SynchronousRestFormsRequester.MakeRequest("POST", 191 reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
190 m_ServerURI + "/grid",
191 reqString);
192 } 192 }
193 catch (Exception e) 193 catch (Exception e)
194 { 194 {
195 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 195 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
196 return rinfos; 196 return rinfos;
197 } 197 }
198 198
@@ -228,15 +228,14 @@ namespace OpenSim.Services.Connectors
228 sendData["METHOD"] = "get_region_by_uuid"; 228 sendData["METHOD"] = "get_region_by_uuid";
229 229
230 string reply = string.Empty; 230 string reply = string.Empty;
231 string uri = m_ServerURI + "/grid";
231 try 232 try
232 { 233 {
233 reply = SynchronousRestFormsRequester.MakeRequest("POST", 234 reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData));
234 m_ServerURI + "/grid",
235 ServerUtils.BuildQueryString(sendData));
236 } 235 }
237 catch (Exception e) 236 catch (Exception e)
238 { 237 {
239 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 238 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
240 return null; 239 return null;
241 } 240 }
242 241
@@ -274,15 +273,16 @@ namespace OpenSim.Services.Connectors
274 273
275 sendData["METHOD"] = "get_region_by_position"; 274 sendData["METHOD"] = "get_region_by_position";
276 string reply = string.Empty; 275 string reply = string.Empty;
276 string uri = m_ServerURI + "/grid";
277 try 277 try
278 { 278 {
279 reply = SynchronousRestFormsRequester.MakeRequest("POST", 279 reply = SynchronousRestFormsRequester.MakeRequest("POST",
280 m_ServerURI + "/grid", 280 uri,
281 ServerUtils.BuildQueryString(sendData)); 281 ServerUtils.BuildQueryString(sendData));
282 } 282 }
283 catch (Exception e) 283 catch (Exception e)
284 { 284 {
285 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 285 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
286 return null; 286 return null;
287 } 287 }
288 288
@@ -318,15 +318,16 @@ namespace OpenSim.Services.Connectors
318 318
319 sendData["METHOD"] = "get_region_by_name"; 319 sendData["METHOD"] = "get_region_by_name";
320 string reply = string.Empty; 320 string reply = string.Empty;
321 string uri = m_ServerURI + "/grid";
321 try 322 try
322 { 323 {
323 reply = SynchronousRestFormsRequester.MakeRequest("POST", 324 reply = SynchronousRestFormsRequester.MakeRequest("POST",
324 m_ServerURI + "/grid", 325 uri,
325 ServerUtils.BuildQueryString(sendData)); 326 ServerUtils.BuildQueryString(sendData));
326 } 327 }
327 catch (Exception e) 328 catch (Exception e)
328 { 329 {
329 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 330 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
330 return null; 331 return null;
331 } 332 }
332 333
@@ -361,15 +362,16 @@ namespace OpenSim.Services.Connectors
361 sendData["METHOD"] = "get_regions_by_name"; 362 sendData["METHOD"] = "get_regions_by_name";
362 List<GridRegion> rinfos = new List<GridRegion>(); 363 List<GridRegion> rinfos = new List<GridRegion>();
363 string reply = string.Empty; 364 string reply = string.Empty;
365 string uri = m_ServerURI + "/grid";
364 try 366 try
365 { 367 {
366 reply = SynchronousRestFormsRequester.MakeRequest("POST", 368 reply = SynchronousRestFormsRequester.MakeRequest("POST",
367 m_ServerURI + "/grid", 369 uri,
368 ServerUtils.BuildQueryString(sendData)); 370 ServerUtils.BuildQueryString(sendData));
369 } 371 }
370 catch (Exception e) 372 catch (Exception e)
371 { 373 {
372 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 374 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
373 return rinfos; 375 return rinfos;
374 } 376 }
375 377
@@ -413,17 +415,19 @@ namespace OpenSim.Services.Connectors
413 415
414 List<GridRegion> rinfos = new List<GridRegion>(); 416 List<GridRegion> rinfos = new List<GridRegion>();
415 string reply = string.Empty; 417 string reply = string.Empty;
418 string uri = m_ServerURI + "/grid";
419
416 try 420 try
417 { 421 {
418 reply = SynchronousRestFormsRequester.MakeRequest("POST", 422 reply = SynchronousRestFormsRequester.MakeRequest("POST",
419 m_ServerURI + "/grid", 423 uri,
420 ServerUtils.BuildQueryString(sendData)); 424 ServerUtils.BuildQueryString(sendData));
421 425
422 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); 426 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply);
423 } 427 }
424 catch (Exception e) 428 catch (Exception e)
425 { 429 {
426 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 430 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
427 return rinfos; 431 return rinfos;
428 } 432 }
429 433
@@ -463,17 +467,18 @@ namespace OpenSim.Services.Connectors
463 467
464 List<GridRegion> rinfos = new List<GridRegion>(); 468 List<GridRegion> rinfos = new List<GridRegion>();
465 string reply = string.Empty; 469 string reply = string.Empty;
470 string uri = m_ServerURI + "/grid";
466 try 471 try
467 { 472 {
468 reply = SynchronousRestFormsRequester.MakeRequest("POST", 473 reply = SynchronousRestFormsRequester.MakeRequest("POST",
469 m_ServerURI + "/grid", 474 uri,
470 ServerUtils.BuildQueryString(sendData)); 475 ServerUtils.BuildQueryString(sendData));
471 476
472 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); 477 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply);
473 } 478 }
474 catch (Exception e) 479 catch (Exception e)
475 { 480 {
476 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 481 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
477 return rinfos; 482 return rinfos;
478 } 483 }
479 484
@@ -515,17 +520,18 @@ namespace OpenSim.Services.Connectors
515 520
516 List<GridRegion> rinfos = new List<GridRegion>(); 521 List<GridRegion> rinfos = new List<GridRegion>();
517 string reply = string.Empty; 522 string reply = string.Empty;
523 string uri = m_ServerURI + "/grid";
518 try 524 try
519 { 525 {
520 reply = SynchronousRestFormsRequester.MakeRequest("POST", 526 reply = SynchronousRestFormsRequester.MakeRequest("POST",
521 m_ServerURI + "/grid", 527 uri,
522 ServerUtils.BuildQueryString(sendData)); 528 ServerUtils.BuildQueryString(sendData));
523 529
524 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); 530 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply);
525 } 531 }
526 catch (Exception e) 532 catch (Exception e)
527 { 533 {
528 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 534 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
529 return rinfos; 535 return rinfos;
530 } 536 }
531 537
@@ -565,17 +571,18 @@ namespace OpenSim.Services.Connectors
565 571
566 List<GridRegion> rinfos = new List<GridRegion>(); 572 List<GridRegion> rinfos = new List<GridRegion>();
567 string reply = string.Empty; 573 string reply = string.Empty;
574 string uri = m_ServerURI + "/grid";
568 try 575 try
569 { 576 {
570 reply = SynchronousRestFormsRequester.MakeRequest("POST", 577 reply = SynchronousRestFormsRequester.MakeRequest("POST",
571 m_ServerURI + "/grid", 578 uri,
572 ServerUtils.BuildQueryString(sendData)); 579 ServerUtils.BuildQueryString(sendData));
573 580
574 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); 581 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply);
575 } 582 }
576 catch (Exception e) 583 catch (Exception e)
577 { 584 {
578 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 585 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
579 return rinfos; 586 return rinfos;
580 } 587 }
581 588
@@ -615,15 +622,16 @@ namespace OpenSim.Services.Connectors
615 sendData["METHOD"] = "get_region_flags"; 622 sendData["METHOD"] = "get_region_flags";
616 623
617 string reply = string.Empty; 624 string reply = string.Empty;
625 string uri = m_ServerURI + "/grid";
618 try 626 try
619 { 627 {
620 reply = SynchronousRestFormsRequester.MakeRequest("POST", 628 reply = SynchronousRestFormsRequester.MakeRequest("POST",
621 m_ServerURI + "/grid", 629 uri,
622 ServerUtils.BuildQueryString(sendData)); 630 ServerUtils.BuildQueryString(sendData));
623 } 631 }
624 catch (Exception e) 632 catch (Exception e)
625 { 633 {
626 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 634 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
627 return -1; 635 return -1;
628 } 636 }
629 637