aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-06-29 18:54:31 +0100
committerJustin Clark-Casey (justincc)2010-06-29 21:08:09 +0100
commit94cb6fc916e1bd039f2b59214e68a0b3c4847445 (patch)
treebc24609a70284270f89ce2b87686a8b6d198e6cb
parentRevert "don't report the null uuid as a missing asset on saving oars/iars" (diff)
downloadopensim-SC-94cb6fc916e1bd039f2b59214e68a0b3c4847445.zip
opensim-SC-94cb6fc916e1bd039f2b59214e68a0b3c4847445.tar.gz
opensim-SC-94cb6fc916e1bd039f2b59214e68a0b3c4847445.tar.bz2
opensim-SC-94cb6fc916e1bd039f2b59214e68a0b3c4847445.tar.xz
stop exceptions in setting and getting state from propogating since they aren't fatal to operations
this will hopefully stop "save oar" from failing if a script asset is corrupt
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs39
1 files changed, 31 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 3a8f168..a6067ad 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -218,7 +218,7 @@ namespace OpenSim.Region.Framework.Scenes
218 foreach (IScriptModule e in engines) 218 foreach (IScriptModule e in engines)
219 { 219 {
220 if (e != null) 220 if (e != null)
221 { 221 {
222 ArrayList errors = e.GetScriptErrors(itemID); 222 ArrayList errors = e.GetScriptErrors(itemID);
223 foreach (Object line in errors) 223 foreach (Object line in errors)
224 ret.Add(line); 224 ret.Add(line);
@@ -356,14 +356,26 @@ namespace OpenSim.Region.Framework.Scenes
356 356
357 m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml; 357 m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml;
358 } 358 }
359
359 foreach (IScriptModule e in engines) 360 foreach (IScriptModule e in engines)
360 { 361 {
361 if (e != null) 362 if (e != null)
362 { 363 {
363 if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[oldID])) 364 // Stop an exception in setting saved state from propogating since this is not fatal.
364 break; 365 try
366 {
367 if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[oldID]))
368 break;
369 }
370 catch (Exception ex)
371 {
372 m_log.WarnFormat(
373 "[PRIM INVENTORY]: Could not set script state for old key {0}, new key {1} in prim {2} {3}. Exception {4}{5}",
374 oldID, newID, m_part.Name, m_part.UUID, ex.Message, ex.StackTrace);
375 }
365 } 376 }
366 } 377 }
378
367 m_part.ParentGroup.m_savedScriptState.Remove(oldID); 379 m_part.ParentGroup.m_savedScriptState.Remove(oldID);
368 } 380 }
369 } 381 }
@@ -1021,12 +1033,23 @@ namespace OpenSim.Region.Framework.Scenes
1021 { 1033 {
1022 if (e != null) 1034 if (e != null)
1023 { 1035 {
1024 string n = e.GetXMLState(item.ItemID); 1036 // Stop any exception from the script engine from propogating since setting state
1025 if (n != String.Empty) 1037 // isn't essential.
1038 try
1039 {
1040 string n = e.GetXMLState(item.ItemID);
1041 if (n != String.Empty)
1042 {
1043 if (!ret.ContainsKey(item.ItemID))
1044 ret[item.ItemID] = n;
1045 break;
1046 }
1047 }
1048 catch (Exception ex)
1026 { 1049 {
1027 if (!ret.ContainsKey(item.ItemID)) 1050 m_log.WarnFormat(
1028 ret[item.ItemID] = n; 1051 "[PRIM INVENTORY]: Could not retrieve script state for item {0} {1} in prim {2} {3}. Exception {4}{5}",
1029 break; 1052 item.Name, item.ItemID, m_part.Name, m_part.UUID, ex.Message, ex.StackTrace);
1030 } 1053 }
1031 } 1054 }
1032 } 1055 }