aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs67
1 files changed, 47 insertions, 20 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 611df58..d725907 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -924,26 +924,53 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
924 { 924 {
925 try 925 try
926 { 926 {
927 // DISPLAY ERROR INWORLD 927
928 string text = FormatException(e); 928 if(e.InnerException != null && e.InnerException is ScriptException)
929 929 {
930 if (text.Length > 1000) 930 string text = e.InnerException.Message +
931 text = text.Substring(0, 1000); 931 "(script: " + ScriptName +
932 Engine.World.SimChat(Utils.StringToBytes(text), 932 " event: " + data.EventName +
933 ChatTypeEnum.DebugChannel, 2147483647, 933 " at " + Part.AbsolutePosition + ")";
934 Part.AbsolutePosition, 934 if (text.Length > 1000)
935 Part.Name, Part.UUID, false); 935 text = text.Substring(0, 1000);
936 936 Engine.World.SimChat(Utils.StringToBytes(text),
937 937 ChatTypeEnum.DebugChannel, 2147483647,
938 m_log.Debug(string.Format( 938 Part.AbsolutePosition,
939 "[SCRIPT INSTANCE]: Runtime error in script {0} (event {1}), part {2} {3} at {4} in {5} ", 939 Part.Name, Part.UUID, false);
940 ScriptName, 940 m_log.Debug(string.Format(
941 data.EventName, 941 "[SCRIPT INSTANCE]: {0} (at event {1}, part {2} {3} at {4} in {5}",
942 PrimName, 942 e.InnerException.Message,
943 Part.UUID, 943 data.EventName,
944 Part.AbsolutePosition, 944 PrimName,
945 Part.ParentGroup.Scene.Name), 945 Part.UUID,
946 e); 946 Part.AbsolutePosition,
947 Part.ParentGroup.Scene.Name));
948
949 }
950 else
951 {
952
953 // DISPLAY ERROR INWORLD
954 string text = FormatException(e);
955
956 if (text.Length > 1000)
957 text = text.Substring(0, 1000);
958 Engine.World.SimChat(Utils.StringToBytes(text),
959 ChatTypeEnum.DebugChannel, 2147483647,
960 Part.AbsolutePosition,
961 Part.Name, Part.UUID, false);
962
963
964 m_log.Debug(string.Format(
965 "[SCRIPT INSTANCE]: Runtime error in script {0} (event {1}), part {2} {3} at {4} in {5} ",
966 ScriptName,
967 data.EventName,
968 PrimName,
969 Part.UUID,
970 Part.AbsolutePosition,
971 Part.ParentGroup.Scene.Name),
972 e);
973 }
947 } 974 }
948 catch (Exception) 975 catch (Exception)
949 { 976 {