Exception Handling

  • Thread starter Thread starter Q2004
  • Start date Start date
Q

Q2004

I am creating my own exception handling class derived from Exception. It is
used to handle tcp connection. Whenver connection failed, it throws an
exception. My question is:

How do I make my exception class to stop further exception from being
re-thrown after the errror is handled/processed ?
 
Classes derived from System.Exception (Microsoft recommends inheriting from
System.ApplicationException for such purpose, by the way) represent custom
exceptions, they are not used to *handle* exceptions.

You should rather use the try..catch..finally construct to handle
exceptions. If you don't place the throw statement somewhere in the "catch"
clause, the exception won't be re-thrown.
 
Back
Top