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.
0.6.0-stable
Charles Krinke 2008-10-04 19:04:58 +00:00
parent 275d4d30a2
commit 2fdb42aec0
2 changed files with 31 additions and 7 deletions

View File

@ -196,13 +196,15 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
SceneObjectPart part = SceneObjectPart part =
lastScriptEngine.World.GetSceneObjectPart( lastScriptEngine.World.GetSceneObjectPart(
lastLocalID); lastLocalID);
if (part != null && part.ParentGroup != null) if (part != null && part.ParentGroup != null)
lastScriptEngine.World.DeleteSceneObject( lastScriptEngine.World.DeleteSceneObject(
part.ParentGroup); part.ParentGroup);
} }
catch (Exception) catch (Exception e)
{ {
if (lastScriptEngine != null)
lastScriptEngine.Log.WarnFormat("[{0}]: Exception {1} thrown",ScriptEngineName,e.GetType().ToString());
throw e;
} }
} }
} }
@ -288,6 +290,16 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
InExecution = false; InExecution = false;
} }
} }
catch (SelfDeleteException sde)
{
// Make sure this exception isn't consumed here... we need it
throw sde;
}
catch (TargetInvocationException tie)
{
// Probably don't need to special case this one
throw tie;
}
catch (Exception e) catch (Exception e)
{ {
InExecution = false; InExecution = false;

View File

@ -191,8 +191,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
//Console.WriteLine("ScriptEngine: Executing function name: " + EventName); //Console.WriteLine("ScriptEngine: Executing function name: " + EventName);
#endif #endif
// Found // Found
try
{
ev.Invoke(m_Script, args); 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() protected void initEventFlags()
{ {