diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
index db71079786..053cb0f8d5 100644
--- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
@@ -57,6 +57,10 @@ namespace OpenSim.Framework.Communications.Cache
///
///
///
+ ///
+ /// Thrown if the request failed for some other reason than that the
+ /// asset cannot be found.
+ ///
protected abstract AssetBase GetAsset(AssetRequest req);
///
@@ -66,17 +70,30 @@ namespace OpenSim.Framework.Communications.Cache
///
protected virtual void ProcessRequest(AssetRequest req)
{
- AssetBase asset = GetAsset(req);
+ AssetBase asset;
+
+ try
+ {
+ asset = GetAsset(req);
+ }
+ catch (Exception e)
+ {
+ m_log.ErrorFormat("[ASSET]: Asset request for {0} threw exception {1}", req.AssetID, e);
+
+ m_receiver.AssetNotFound(req.AssetID, req.IsTexture);
+
+ return;
+ }
if (asset != null)
{
- //m_log.InfoFormat("[ASSETSERVER]: Asset {0} received from asset server", req.AssetID);
+ m_log.DebugFormat("[ASSET]: Asset {0} received from asset server", req.AssetID);
m_receiver.AssetReceived(asset, req.IsTexture);
}
else
{
- //m_log.ErrorFormat("[ASSET SERVER]: Asset {0} not found by asset server", req.AssetID);
+ m_log.WarnFormat("[ASSET]: Asset {0} not found by asset server", req.AssetID);
m_receiver.AssetNotFound(req.AssetID, req.IsTexture);
}
diff --git a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
index 4b4ef17fe9..778780581f 100644
--- a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
+++ b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
@@ -49,38 +49,30 @@ namespace OpenSim.Framework.Communications.Cache
protected override AssetBase GetAsset(AssetRequest req)
{
- Stream s = null;
- try
+ #if DEBUG
+ //m_log.DebugFormat("[GRID ASSET CLIENT]: Querying for {0}", req.AssetID.ToString());
+ #endif
+
+ RestClient rc = new RestClient(_assetServerUrl);
+ rc.AddResourcePath("assets");
+ rc.AddResourcePath(req.AssetID.ToString());
+ if (req.IsTexture)
+ rc.AddQueryParameter("texture");
+
+ rc.RequestMethod = "GET";
+
+ Stream s = rc.Request();
+
+ if (s.Length > 0)
{
- #if DEBUG
- //m_log.DebugFormat("[GRID ASSET CLIENT]: Querying for {0}", req.AssetID.ToString());
- #endif
+ XmlSerializer xs = new XmlSerializer(typeof (AssetBase));
- RestClient rc = new RestClient(_assetServerUrl);
- rc.AddResourcePath("assets");
- rc.AddResourcePath(req.AssetID.ToString());
- if (req.IsTexture)
- rc.AddQueryParameter("texture");
-
- rc.RequestMethod = "GET";
- s = rc.Request();
-
- if (s.Length > 0)
- {
- XmlSerializer xs = new XmlSerializer(typeof (AssetBase));
-
- return (AssetBase) xs.Deserialize(s);
- }
- }
- catch (Exception e)
- {
- m_log.ErrorFormat("[GRID ASSET CLIENT]: Failed to get asset {0}, {1}", req.AssetID, e);
+ return (AssetBase) xs.Deserialize(s);
}
return null;
}
-
public override void UpdateAsset(AssetBase asset)
{
throw new Exception("The method or operation is not implemented.");