Chris,
Many thanks for the reply and level of detail - very instructive. I am using
.NET 1.0 (with patches...) as I am tied to VS.NET 2002 for the moment.
I have got my catches in the correct order, and was suprised that you can
nearly whack Google with the problem. I'm presuming that the framework
version may be at the root of things as you suggested.
I am perplexed that a call to ex.GetType().ToString() returns the type that
would be expected i.e "Microsoft.JScript.JScriptException", but trying:
ex.GetType() == typeof(Microsoft.JScript.JScriptException)
evaluates to false. If you attempt to cast the Exception to a
JScriptException, the whole thing blows up!
The text in jscriptexception.cs which reads:
> ... In fact a
> JScriptException is also a IVsaError and thus it can be
> // passed to the host through IVsaSite.OnCompilerError(IVsaError
> error).
is interesting, as the error that is being raised is the result of a failed
call to 'eval' through a wrapper. Would this error be handled by
OnCompileError and cause some side-effect???
I will investigate trapping the error and passing the JScriptException back
as an inner exception (or what-have-you) as I would like to get at the error
number.
Many Thanks, Tim.
> > I am calling an external dll (compiled JScript) from within a
> > try/catch/finally block in a C# program and am unable to catch
[quoted text clipped - 64 lines]
> C.R. Timmons Consulting, Inc.
> http://www.crtimmonsinc.com/
bB - 17 Oct 2003 22:59 GMT
If I put a break line in and do a quick-watch on "ex" it will give me access
to the JScriptException via a cast, but if I try to cast the exception in
code it blows up... Very weird.
> Chris,
>
[quoted text clipped - 98 lines]
> > C.R. Timmons Consulting, Inc.
> > http://www.crtimmonsinc.com/