throw ex : If we use "throw ex" statement, stack trace of exception will be replaced with a stack trace starting at the re-throw point. It is used to intentionally hide stack trace information.
- catch (Exception ex)
- {
- // do some stuff here
- throw; // a) continue ex
- throw new MyException("failed", ex); // b) wrap
- throw new MyException("failed"); // c) replace
- throw ex; // d) reset stack-trace
- }

Sertunc SELENPosted Aug 15, 2024, 5:54 PM
Thank you. it is very clear
Ramzanali MominPosted Nov 5, 2018, 7:34 AM
Nice article sir