From d6519924ba096c569294aa6653e6720629002f8e Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 13 Jun 2008 18:04:01 +0000 Subject: * refactor: catch asset service request exceptions at the AssetServerBase level rather than in the GridAssetClient * this is to enable logging of asset request exceptions soon --- .../Communications/Cache/AssetServerBase.cs | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'OpenSim/Framework/Communications/Cache/AssetServerBase.cs') diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs index db71079..053cb0f 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); } -- cgit v1.1