?
namespace Program
{
class ReJoice
{
public void End()
{
throw new Exception();
}
}
class Program
{
static void Main(string[] args)
{
try
{
ReJoice x = new ReJoice();
x.End();
}
catch (Exception e) {
throw e;
}
}
}
}
Edit: It does not throw an exception because the catch value is intended to handle the exception. It is up to you as the caller of x.End () what you want to do when an exception occurs. By catching the exception and doing nothing, you say you want to ignore the exception. In the catch block, you can display a message box or register an error message, completely destroy the application or reinstall the error with additional information, wrapping an exception:
throw new Exception("New message", e);
source
share