CSharp examples for Custom Type:Exception
You can capture and rethrow an exception as follows:
try { ... } catch (Exception ex) { // Log error ... throw; // Rethrow same exception }
Rethrowing in this manner lets you log an error without swallowing it.