diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMRInstAbstract.cs b/OpenSim/Region/ScriptEngine/YEngine/XMRInstAbstract.cs index f0beb6bf5a..adc33f40fb 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMRInstAbstract.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMRInstAbstract.cs @@ -2043,7 +2043,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine public class OutOfHeapException: Exception { public OutOfHeapException(int oldtotal, int newtotal, int limit) - : base("oldtotal=" + oldtotal + ", newtotal=" + newtotal + ", limit=" + limit) + : base("(OWNER)oldtotal=" + oldtotal + ", newtotal=" + newtotal + ", limit=" + limit) { } } diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs b/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs index 9a10e953ad..3dd7573481 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs @@ -541,6 +541,11 @@ namespace OpenSim.Region.ScriptEngine.Yengine //m_RunOnePhase = "resetting..."; ResetLocked("HandleScriptResetException"); } + else if (e is OutOfHeapException) + { + // Some general script error. + SendScriptErrorMessage(e, curevent); + } else if (e is ScriptException) { // Some general script error. @@ -558,15 +563,18 @@ namespace OpenSim.Region.ScriptEngine.Yengine StringBuilder msg = new StringBuilder(); bool toowner = false; msg.Append("YEngine: "); - if (e.Message != null) + string evMessage = null; + if (e != null && !string.IsNullOrEmpty(e.Message)) { - string text = e.Message; - if (text.StartsWith("(OWNER)")) + evMessage = e.Message; + if (evMessage.StartsWith("(OWNER)")) { - text = text.Substring(7); + evMessage = evMessage.Substring(7); toowner = true; } - msg.Append(text); + if (e is OutOfHeapException) + evMessage = "OutOfHeap: " + evMessage; + msg.Append(evMessage); } msg.Append(" (script: "); @@ -602,7 +610,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine m_Part.Name, m_Part.UUID, false); m_log.Debug(string.Format( "[SCRIPT ERROR]: {0} (at event {1}, part {2} {3} at {4} in {5}", - (e.Message == null)? "" : e.Message, + (string.IsNullOrEmpty(evMessage) ? "" : evMessage), ev.ToString(), m_Part.Name, m_Part.UUID,