Link to home
Start Free TrialLog in
Avatar of Camillia
CamilliaFlag for United States of America

asked on

Is this correct throw-catch?

Not sure if I'm doing this correctly.

private void SaveRecords()
{

  try

   {
      Return.Save();
   }

  catch

   {
     //log to file here
   
     ..

    ///display error to user
     message.Show("error");

   }

}


In return class:


private void SaveRecords()
{

  try

   {
      Return.Save();
   }

  catch (Exception e)

   {
     throw e;
   

   }

}
SOLUTION
Avatar of Obadiah Christopher
Obadiah Christopher
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Camillia

ASKER

But that "throw" is ok? I will look into non-generic exception