Excpetion Handling

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Consider this....
public sqldatareader somefunction(){
try
{
sqldatareader sr=sqlcommand.executereader();
return sr;
}
catch
{
throw;
}
}

my question is why bother with try/catch, if I have to throw an exception?
 
In this specific case, you would not gain anything since your catch is not
doing anything other then rethrowing the exception, and you don't have a
finally block.
 
Thanks for your response...

So, I'm going to handle the exception at client side (caller of the method).
Just curious , what would be the best way to handle exceptions in this or
similar cases...Any best practices?
 
Back
Top