yengine, only send out of heap errors to owner and wigotu stacktrace

This commit is contained in:
UbitUmarov
2022-03-09 22:03:55 +00:00
parent 0e5abf6bc1
commit 60e67e5320
2 changed files with 15 additions and 7 deletions

View File

@@ -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)
{
}
}

View File

@@ -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,