[Ironruby-core] Determining line number of runtime errors

Benjamin van der Veen
Thu, 11 Dec 2008 19:56:07 -0000

Michael Letterle wrote:
> You should be able to pass in "-D" to ir.exe to get this
information.
>

Oops, perhaps I should have been more specific about what I''m doing.
I''m
not actually using ir.exe, I''m creating
ScriptRuntime/ScriptEngine/ScriptScope/ScriptSource in C# code.

I''m wrapping the call to aScriptSource.Execute(aScriptScope) in a
try-catch block. One of my catch blocks explicitly catches a
SyntaxErrorException, which as I mentioned before has a Line property. I
notice that runtime errors cause many different type of exceptions, so
I''m speculating that there must be some other mechanism for determining
what line the error occurred on.