diff options
author | Justin Clark-Casey (justincc) | 2010-06-29 18:54:31 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-06-29 18:54:31 +0100 |
commit | ae2454821628d847b0add20a4c593162baafde5b (patch) | |
tree | 8809fb3acb93960554da0a85d808a0d4dc2e7cc7 /OpenSim/Region/Framework/Scenes | |
parent | revert group membership checking to older code pending resolution of reported... (diff) | |
download | opensim-SC-ae2454821628d847b0add20a4c593162baafde5b.zip opensim-SC-ae2454821628d847b0add20a4c593162baafde5b.tar.gz opensim-SC-ae2454821628d847b0add20a4c593162baafde5b.tar.bz2 opensim-SC-ae2454821628d847b0add20a4c593162baafde5b.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.cs | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index d175695..5ab7d20 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -217,7 +217,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
217 | foreach (IScriptModule e in engines) | 217 | foreach (IScriptModule e in engines) |
218 | { | 218 | { |
219 | if (e != null) | 219 | if (e != null) |
220 | { | 220 | { |
221 | ArrayList errors = e.GetScriptErrors(itemID); | 221 | ArrayList errors = e.GetScriptErrors(itemID); |
222 | foreach (Object line in errors) | 222 | foreach (Object line in errors) |
223 | ret.Add(line); | 223 | ret.Add(line); |
@@ -359,14 +359,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
359 | 359 | ||
360 | m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml; | 360 | m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml; |
361 | } | 361 | } |
362 | |||
362 | foreach (IScriptModule e in engines) | 363 | foreach (IScriptModule e in engines) |
363 | { | 364 | { |
364 | if (e != null) | 365 | if (e != null) |
365 | { | 366 | { |
366 | if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[oldID])) | 367 | // Stop an exception in setting saved state from propogating since this is not fatal. |
367 | break; | 368 | try |
369 | { | ||
370 | if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[oldID])) | ||
371 | break; | ||
372 | } | ||
373 | catch (Exception ex) | ||
374 | { | ||
375 | m_log.WarnFormat( | ||
376 | "[PRIM INVENTORY]: Could not set script state for old key {0}, new key {1} in prim {2} {3}. Exception {4}{5}", | ||
377 | oldID, newID, m_part.Name, m_part.UUID, ex.Message, ex.StackTrace); | ||
378 | } | ||
368 | } | 379 | } |
369 | } | 380 | } |
381 | |||
370 | m_part.ParentGroup.m_savedScriptState.Remove(oldID); | 382 | m_part.ParentGroup.m_savedScriptState.Remove(oldID); |
371 | } | 383 | } |
372 | } | 384 | } |
@@ -1028,12 +1040,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
1028 | { | 1040 | { |
1029 | if (e != null) | 1041 | if (e != null) |
1030 | { | 1042 | { |
1031 | string n = e.GetXMLState(item.ItemID); | 1043 | // Stop any exception from the script engine from propogating since setting state |
1032 | if (n != String.Empty) | 1044 | // isn't essential. |
1045 | try | ||
1046 | { | ||
1047 | string n = e.GetXMLState(item.ItemID); | ||
1048 | if (n != String.Empty) | ||
1049 | { | ||
1050 | if (!ret.ContainsKey(item.ItemID)) | ||
1051 | ret[item.ItemID] = n; | ||
1052 | break; | ||
1053 | } | ||
1054 | } | ||
1055 | catch (Exception ex) | ||
1033 | { | 1056 | { |
1034 | if (!ret.ContainsKey(item.ItemID)) | 1057 | m_log.WarnFormat( |
1035 | ret[item.ItemID] = n; | 1058 | "[PRIM INVENTORY]: Could not retrieve script state for item {0} {1} in prim {2} {3}. Exception {4}{5}", |
1036 | break; | 1059 | item.Name, item.ItemID, m_part.Name, m_part.UUID, ex.Message, ex.StackTrace); |
1037 | } | 1060 | } |
1038 | } | 1061 | } |
1039 | } | 1062 | } |