C Sharp (C#) - Exception Handling
Which of the following is a correct way to rethrow an exception in a
catch block without losing the original stack trace?catch block without losing the original stack trace?throw; inside a catch block rethrows the current exception preserving the original stack trace.throw ex; resets stack trace, throw new Exception(ex.Message); creates a new exception losing original info, and throw ex.InnerException; throws a different exception.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions