C Sharp (C#) - Exception Handling
You want to log an exception message but still rethrow it preserving the original stack trace. Which pattern is best?
throw; rethrows the exception preserving stack trace.throw ex; resets stack trace, throw new Exception(...) creates new exception, and return; swallows exception.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions