diff options
author | Melanie Thielker | 2008-10-07 21:59:56 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-10-07 21:59:56 +0000 |
commit | 638cce09d141a27627c6fa1aa65647df064a6eff (patch) | |
tree | b0672a13bdfbaa560199a6b593a325ada0b60b24 /OpenSim/Region/ScriptEngine/Shared/CodeTools | |
parent | * Comment out debug throttle output that I had accidentally left in (diff) | |
download | opensim-SC_OLD-638cce09d141a27627c6fa1aa65647df064a6eff.zip opensim-SC_OLD-638cce09d141a27627c6fa1aa65647df064a6eff.tar.gz opensim-SC_OLD-638cce09d141a27627c6fa1aa65647df064a6eff.tar.bz2 opensim-SC_OLD-638cce09d141a27627c6fa1aa65647df064a6eff.tar.xz |
Restore "friendly errors" to the XEngine
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs index e8f2b71..a825eff 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | |||
@@ -99,10 +99,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
99 | string message; | 99 | string message; |
100 | 100 | ||
101 | // LL start numbering lines at 0 - geeks! | 101 | // LL start numbering lines at 0 - geeks! |
102 | // Also need to subtract one line we prepend! | ||
102 | // | 103 | // |
104 | string emessage = e.Message; | ||
105 | string slinfo = e.slInfo.ToString(); | ||
106 | |||
107 | // Remove wrong line number info | ||
108 | // | ||
109 | if (emessage.StartsWith(slinfo+": ")) | ||
110 | emessage = emessage.Substring(slinfo.Length+2); | ||
111 | |||
103 | message = String.Format("Line ({0},{1}) {2}", | 112 | message = String.Format("Line ({0},{1}) {2}", |
104 | e.slInfo.lineNumber - 1, | 113 | e.slInfo.lineNumber - 2, |
105 | e.slInfo.charPosition - 1, e.Message); | 114 | e.slInfo.charPosition - 1, emessage); |
106 | 115 | ||
107 | throw new Exception(message); | 116 | throw new Exception(message); |
108 | } | 117 | } |