Determining whether an applications has thrown some error ...

  • Thread starter Thread starter Raj
  • Start date Start date
R

Raj

How to determine that an application has thrown some error without using any
variables?

I need to execute a block of code only if there is no error. I know we can
set some flag and check the flag whether error is thrown or not ... whether
the CLR provides any mechasim without setting flags ...?

Any help would be appreciated

Thank you

Regards
Raj
 
How to determine that an application has thrown some error without using
any
variables?

I need to execute a block of code only if there is no error. I know we
can
set some flag and check the flag whether error is thrown or not ...
whether
the CLR provides any mechasim without setting flags ...?

It depends on where the error happens and what type it is versus where you
want to execute the code. If the error is an exception (as your use of
the word "thrown" implies) you can put the code in a catch block and it
will execute "immediately" after the error is thrown (depending on the
rest of the code).

Otherwise, no. You'll just have to do things the "hard way".

Pete
 
AFAIK no plus the error could have been thrown much earlier somewhere that
is unrelated to the area you are interested in.

Have you tried the usual try/catch ? If yes, the problem is ?

Or from your earlier post do you try to code without using any variable ;-)
 
Back
Top