If I put in the catch clause:
...
catch(Exception e)
{
throw new Exception("msg", e);
}
Am I throwing or re-throwing the e exception?
So is correct to say that the throw clause used
into a catch is re-throwing an exception while using it
into a try block or elsewhere is throwing an exception?
Ultimately when or where thow throw an exception and when or where re-throw an exception?
Thanks.
You throw an exception the first time.
You re-throw a caught exception
You wrap an exception by throwing a different exception which contains that exception.