aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorCharles Krinke2008-10-04 19:04:58 +0000
committerCharles Krinke2008-10-04 19:04:58 +0000
commit2fdb42aec03be76f8208d591009994aff7a5c2d8 (patch)
tree05ad8d869f42e5854b3c0782fcd4b68d62cfebab
parentRemove two warnings by assigning string provider = "" (diff)
downloadopensim-SC-2fdb42aec03be76f8208d591009994aff7a5c2d8.zip
opensim-SC-2fdb42aec03be76f8208d591009994aff7a5c2d8.tar.gz
opensim-SC-2fdb42aec03be76f8208d591009994aff7a5c2d8.tar.bz2
opensim-SC-2fdb42aec03be76f8208d591009994aff7a5c2d8.tar.xz
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.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs22
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs16
2 files changed, 31 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs
index 2306bce..f568dc5 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs
@@ -196,13 +196,15 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
196 SceneObjectPart part = 196 SceneObjectPart part =
197 lastScriptEngine.World.GetSceneObjectPart( 197 lastScriptEngine.World.GetSceneObjectPart(
198 lastLocalID); 198 lastLocalID);
199
200 if (part != null && part.ParentGroup != null) 199 if (part != null && part.ParentGroup != null)
201 lastScriptEngine.World.DeleteSceneObject( 200 lastScriptEngine.World.DeleteSceneObject(
202 part.ParentGroup); 201 part.ParentGroup);
203 } 202 }
204 catch (Exception) 203 catch (Exception e)
205 { 204 {
205 if (lastScriptEngine != null)
206 lastScriptEngine.Log.WarnFormat("[{0}]: Exception {1} thrown",ScriptEngineName,e.GetType().ToString());
207 throw e;
206 } 208 }
207 } 209 }
208 } 210 }
@@ -288,11 +290,21 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
288 InExecution = false; 290 InExecution = false;
289 } 291 }
290 } 292 }
293 catch (SelfDeleteException sde)
294 {
295 // Make sure this exception isn't consumed here... we need it
296 throw sde;
297 }
298 catch (TargetInvocationException tie)
299 {
300 // Probably don't need to special case this one
301 throw tie;
302 }
291 catch (Exception e) 303 catch (Exception e)
292 { 304 {
293 InExecution = false; 305 InExecution = false;
294 string text = FormatException(e, QIS.LineMap); 306 string text = FormatException(e, QIS.LineMap);
295 307
296 // DISPLAY ERROR INWORLD 308 // DISPLAY ERROR INWORLD
297 309
298// if (e.InnerException != null) 310// if (e.InnerException != null)
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
156 string EventName = state + "_event_" + FunctionName; 156 string EventName = state + "_event_" + FunctionName;
157 157
158//#if DEBUG 158//#if DEBUG
159// Console.WriteLine("ScriptEngine: Script event function name: " + EventName); 159 //Console.WriteLine("ScriptEngine: Script event function name: " + EventName);
160//#endif 160//#endif
161 161
162 if (Events.ContainsKey(EventName) == false) 162 if (Events.ContainsKey(EventName) == false)
@@ -191,7 +191,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
191 //Console.WriteLine("ScriptEngine: Executing function name: " + EventName); 191 //Console.WriteLine("ScriptEngine: Executing function name: " + EventName);
192#endif 192#endif
193 // Found 193 // Found
194 ev.Invoke(m_Script, args); 194 try
195 {
196 ev.Invoke(m_Script, args);
197 }
198 catch (TargetInvocationException tie)
199 {
200 // Grab the inner exception and rethrow it
201 throw tie.InnerException;
202 }
203 catch (Exception e)
204 {
205 throw e;
206 }
195 } 207 }
196 208
197 protected void initEventFlags() 209 protected void initEventFlags()