From 2fdb42aec03be76f8208d591009994aff7a5c2d8 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sat, 4 Oct 2008 19:04:58 +0000 Subject: Mantis#2316. Thank you kindly, CMickeyb for a patch that: Addresses llDie issues. The attached patch catches run time exceptions that occur during method invocation (of type TargetInvocationException) and exposes the internal exception. This makes it possible to pass out the SelfDeleteException. Also added handlers in a couple places to make sure that exception was being passed out far enough to be handled correctly. Tested on DNE. --- .../Region/ScriptEngine/Shared/Api/Runtime/Executor.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs index aee03ef..5c1c57a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs @@ -156,7 +156,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase string EventName = state + "_event_" + FunctionName; //#if DEBUG -// Console.WriteLine("ScriptEngine: Script event function name: " + EventName); + //Console.WriteLine("ScriptEngine: Script event function name: " + EventName); //#endif if (Events.ContainsKey(EventName) == false) @@ -191,7 +191,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase //Console.WriteLine("ScriptEngine: Executing function name: " + EventName); #endif // Found - ev.Invoke(m_Script, args); + try + { + ev.Invoke(m_Script, args); + } + catch (TargetInvocationException tie) + { + // Grab the inner exception and rethrow it + throw tie.InnerException; + } + catch (Exception e) + { + throw e; + } } protected void initEventFlags() -- cgit v1.1