From 7402c2d288045fc817c2da8ae6b336253a57b290 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Mon, 25 Aug 2008 21:26:58 +0000
Subject: * Deal with a WebException thrown if a grid server cannot be
contacted for region information
---
.../Region/Communications/OGS1/OGS1GridServices.cs | 29 +++++++++++++++++-----
1 file changed, 23 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region/Communications/OGS1')
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index 7baaa16..4346ecb 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -282,10 +282,14 @@ namespace OpenSim.Region.Communications.OGS1
}
///
- ///
+ /// Request information about a region.
///
///
- ///
+ ///
+ /// null on a failure to contact or get a response from the grid server
+ /// FIXME: Might be nicer to return a proper exception here since we could inform the client more about the
+ /// nature of the faiulre.
+ ///
public RegionInfo RequestNeighbourInfo(LLUUID Region_UUID)
{
RegionInfo regionInfo;
@@ -294,10 +298,23 @@ namespace OpenSim.Region.Communications.OGS1
requestData["authkey"] = serversInfo.GridSendKey;
ArrayList SendParams = new ArrayList();
SendParams.Add(requestData);
- XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams);
- XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 3000);
+ XmlRpcRequest gridReq = new XmlRpcRequest("simulator_data_request", SendParams);
+ XmlRpcResponse gridResp = null;
+
+ try
+ {
+ gridResp = gridReq.Send(serversInfo.GridURL, 3000);
+ }
+ catch (WebException e)
+ {
+ m_log.ErrorFormat(
+ "[OGS1 GRID SERVICES]: Communication with the grid server at {0} failed, {1}",
+ serversInfo.GridURL, e);
+
+ return null;
+ }
- Hashtable responseData = (Hashtable) GridResp.Value;
+ Hashtable responseData = (Hashtable)gridResp.Value;
if (responseData.ContainsKey("error"))
{
@@ -335,7 +352,7 @@ namespace OpenSim.Region.Communications.OGS1
}
///
- ///
+ /// Request information about a region.
///
///
///
--
cgit v1.1