diff options
author | Melanie Thielker | 2008-09-27 05:31:43 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-27 05:31:43 +0000 |
commit | 85068dae60db02b168a29ffd75e1408e30d279e1 (patch) | |
tree | 8389c246a6e9891eb1bf310b85cba19a1668d790 /OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | |
parent | Mantis #2277 (diff) | |
download | opensim-SC_OLD-85068dae60db02b168a29ffd75e1408e30d279e1.zip opensim-SC_OLD-85068dae60db02b168a29ffd75e1408e30d279e1.tar.gz opensim-SC_OLD-85068dae60db02b168a29ffd75e1408e30d279e1.tar.bz2 opensim-SC_OLD-85068dae60db02b168a29ffd75e1408e30d279e1.tar.xz |
Add friendly error messages to both engines.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs index 86d6188..e8f2b71 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | |||
@@ -89,7 +89,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
89 | ResetCounters(); | 89 | ResetCounters(); |
90 | Parser p = new LSLSyntax(new yyLSLSyntax(), new ErrorHandler(true)); | 90 | Parser p = new LSLSyntax(new yyLSLSyntax(), new ErrorHandler(true)); |
91 | // Obviously this needs to be in a try/except block. | 91 | // Obviously this needs to be in a try/except block. |
92 | LSL2CSCodeTransformer codeTransformer = new LSL2CSCodeTransformer(p.Parse(script)); | 92 | LSL2CSCodeTransformer codeTransformer; |
93 | try | ||
94 | { | ||
95 | codeTransformer = new LSL2CSCodeTransformer(p.Parse(script)); | ||
96 | } | ||
97 | catch (CSToolsException e) | ||
98 | { | ||
99 | string message; | ||
100 | |||
101 | // LL start numbering lines at 0 - geeks! | ||
102 | // | ||
103 | message = String.Format("Line ({0},{1}) {2}", | ||
104 | e.slInfo.lineNumber - 1, | ||
105 | e.slInfo.charPosition - 1, e.Message); | ||
106 | |||
107 | throw new Exception(message); | ||
108 | } | ||
109 | |||
93 | m_astRoot = codeTransformer.Transform(); | 110 | m_astRoot = codeTransformer.Transform(); |
94 | 111 | ||
95 | string retstr = String.Empty; | 112 | string retstr = String.Empty; |