error handling question

  • Thread starter Thread starter George Hardy
  • Start date Start date
G

George Hardy

in vs2003, this used to work:

try
<code>
catch ex as exception
msgbox "Error: " & ex.message
end try

in vs2005, this does not seem to throw a message box up, even tho it does
make it in the catch...when i try to examine the "ex" variable, it says it
is not declared in the current scope. why is this? It kind of makes it
hard to debug if i cant examine the exception object.

any suggestions?

thanks!
g hardy
 
George Hardy said:
in vs2003, this used to work:

try
<code>
catch ex as exception
msgbox "Error: " & ex.message
end try

in vs2005, this does not seem to throw a message box up, even tho it
does make it in the catch...when i try to examine the "ex" variable,
it says it is not declared in the current scope. why is this? It
kind of makes it hard to debug if i cant examine the exception
object.

any suggestions?

What else happens instead of the message box? Does the code continue after
the End Try? If not, what's the callstack if you press Ctrl+Break?
In general, it should work; as it does here.


Armin
 
George Hardy said:
in vs2003, this used to work:

try
<code>
catch ex as exception
msgbox "Error: " & ex.message
end try

in vs2005, this does not seem to throw a message box up, even tho it does
make it in the catch...when i try to examine the "ex" variable, it says it
is not declared in the current scope. why is this? It kind of makes it
hard to debug if i cant examine the exception object.

It should work too in VB 2005. On my machine it just works fine, the
message is shown and I can examine the 'ex' variable in the debugger when
placing a breakpoint on the 'MsgBox' call.
 
Back
Top