Complete the code to rethrow the caught exception preserving the original stack trace.
try { // Some code } catch (Exception ex) { [1]; }
Using throw alone rethrows the current exception preserving the original stack trace.
Complete the code to throw a new exception with a custom message inside the catch block.
try { // Some code } catch (Exception ex) { throw new Exception([1], ex); }
The first argument is the custom message string for the new exception.
Fix the error in the catch block to correctly rethrow the exception preserving the stack trace.
try { // Some code } catch (Exception ex) { [1]; }
Using throw alone rethrows the original exception with its stack trace intact.
Fill both blanks to create a try-catch that logs the exception message and then rethrows it preserving the stack trace.
try { // Some code } catch (Exception ex) { Console.[1](ex.Message); [2]; }
Use Console.WriteLine to print the message and throw to rethrow preserving the stack trace.
Fill all three blanks to catch an exception, wrap it in a new exception with a custom message, and throw it.
try { // Some code } catch (Exception [1]) { throw new Exception([2], [3]); }
The catch variable is named ex. The new exception message is a string, and the original exception ex is passed as inner exception.