mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
Restore "friendly errors" to the XEngine
This commit is contained in:
@@ -197,13 +197,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
}
|
||||
catch (TargetInvocationException tie)
|
||||
{
|
||||
// Grab the inner exception and rethrow it, unless the inner
|
||||
// exception is an EventAbortException as this indicates event
|
||||
// invokation termination due to a state change.
|
||||
if ( !(tie.InnerException is EventAbortException) )
|
||||
{
|
||||
throw tie.InnerException;
|
||||
}
|
||||
// Grab the inner exception and rethrow it, unless the inner
|
||||
// exception is an EventAbortException as this indicates event
|
||||
// invocation termination due to a state change.
|
||||
// DO NOT THROW JUST THE INNER EXCEPTION!
|
||||
// FriendlyErrors depends on getting the whole exception!
|
||||
//
|
||||
if ( !(tie.InnerException is EventAbortException) )
|
||||
{
|
||||
throw tie;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -99,10 +99,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||
string message;
|
||||
|
||||
// LL start numbering lines at 0 - geeks!
|
||||
// Also need to subtract one line we prepend!
|
||||
//
|
||||
string emessage = e.Message;
|
||||
string slinfo = e.slInfo.ToString();
|
||||
|
||||
// Remove wrong line number info
|
||||
//
|
||||
if (emessage.StartsWith(slinfo+": "))
|
||||
emessage = emessage.Substring(slinfo.Length+2);
|
||||
|
||||
message = String.Format("Line ({0},{1}) {2}",
|
||||
e.slInfo.lineNumber - 1,
|
||||
e.slInfo.charPosition - 1, e.Message);
|
||||
e.slInfo.lineNumber - 2,
|
||||
e.slInfo.charPosition - 1, emessage);
|
||||
|
||||
throw new Exception(message);
|
||||
}
|
||||
|
||||
@@ -613,27 +613,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
m_InEvent = false;
|
||||
m_CurrentEvent = String.Empty;
|
||||
|
||||
if (!(e is TargetInvocationException) || (!(e.InnerException is EventAbortException) && (!(e.InnerException is SelfDeleteException))))
|
||||
if (!(e is TargetInvocationException) || !(e.InnerException is SelfDeleteException))
|
||||
{
|
||||
if (e is System.Threading.ThreadAbortException)
|
||||
{
|
||||
lock (m_EventQueue)
|
||||
{
|
||||
if ((m_EventQueue.Count > 0) && m_RunEvents && (!m_ShuttingDown))
|
||||
{
|
||||
m_CurrentResult=m_Engine.QueueEventHandler(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_CurrentResult = null;
|
||||
}
|
||||
}
|
||||
|
||||
m_DetectParams = null;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// DISPLAY ERROR INWORLD
|
||||
|
||||
Reference in New Issue
Block a user