From b199a2dea3998ac74a9223c73df89f72854438a3 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 23 Aug 2012 23:13:53 +0100 Subject: [PATCH] If a script state save fails for some reason on shutdown/region removal, get xengine to spit out some useful information and continue to save other script states --- .../Region/ScriptEngine/XEngine/XEngine.cs | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 1571fb4505..5311313f00 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -589,7 +589,19 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (m_Assemblies.ContainsKey(instance.AssetID)) { string assembly = m_Assemblies[instance.AssetID]; - instance.SaveState(assembly); + + try + { + instance.SaveState(assembly); + } + catch (Exception e) + { + m_log.Error( + string.Format( + "[XEngine]: Failed final state save for script {0}.{1}, item UUID {2}, prim UUID {3} in {4}. Exception ", + instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, World.Name) + , e); + } } // Clear the event queue and abort the instance thread @@ -707,7 +719,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine assembly = m_Assemblies[i.AssetID]; } - i.SaveState(assembly); + try + { + i.SaveState(assembly); + } + catch (Exception e) + { + m_log.Error( + string.Format( + "[XEngine]: Failed to save state of script {0}.{1}, item UUID {2}, prim UUID {3} in {4}. Exception ", + i.PrimName, i.ScriptName, i.ItemID, i.ObjectID, World.Name) + , e); + } } instances.Clear();