About exceptions handling

  • Thread starter Thread starter Diego F.
  • Start date Start date
D

Diego F.

Hi all. I have a doubt about exception.

If I have a large method that can throw an exception in many lines, and I
have the mehtod inside a try-catch block, how can I know where the exception
is throwed exactly?
 
Diego F. said:
Hi all. I have a doubt about exception.

If I have a large method that can throw an exception in many lines,
and I have the mehtod inside a try-catch block, how can I know where
the exception is throwed exactly?

If you want to distinguish between the different locations within the code,
you must split the code and put Throw/Catch around each part.


Armin
 
Armin Zingler said:
If you want to distinguish between the different locations within the
code,
you must split the code and put Throw/Catch around each part.


Armin

That is what I thought, thank you.
 
Hi all. I have a doubt about exception.

If I have a large method that can throw an exception in many lines, and I
have the mehtod inside a try-catch block, how can I know where the exception
is throwed exactly?

--

Regards,

Diego F.

In addition to Armin (who imo gave the correct answer),

If you are catching the exception at debug time, the exception object
will most generally include the line number that threw the exception.
While that tidbit of info probably isn't the solution to your problem,
it may help searchers of the newsgroup archive.

Thanks,

Seth Rowe
 
Back
Top