From 1be19c7f42e3f47a89385f8a6fe18b5150e25249 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Mon, 5 Apr 2010 19:46:43 +0100 Subject: [PATCH] log exceptions that end up at the top of a asynchronous viewer packet method call rather than swallowing them --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 7ccdd58c98..516c23b37d 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -641,7 +641,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (pprocessor.Async) { object obj = new AsyncPacketProcess(this, pprocessor.method, packet); - Util.FireAndForget(ProcessSpecificPacketAsync,obj); + Util.FireAndForget(ProcessSpecificPacketAsync, obj); result = true; } else @@ -669,7 +669,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void ProcessSpecificPacketAsync(object state) { AsyncPacketProcess packetObject = (AsyncPacketProcess)state; - packetObject.result = packetObject.Method(packetObject.ClientView, packetObject.Pack); + + try + { + packetObject.result = packetObject.Method(packetObject.ClientView, packetObject.Pack); + } + catch (Exception e) + { + // Make sure that we see any exception caused by the asynchronous operation. + m_log.Error( + string.Format("[LLCLIENTVIEW]: Caught exception while processing {0}", packetObject.Pack), e); + } } #endregion Packet Handling @@ -11695,4 +11705,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(dialog, ThrottleOutPacketType.Task); } } -} \ No newline at end of file +}