Mock Test 3

  1. In your application, you have implemented the LogException(string message) method to log exceptions. When an exception is thrown from your application, you want to log and rethrow the original exception. How do you achieve this?
    1. catch(Exception ex){LogException(ex.Message); throw;}

    2. catch(Exception ex){LogException(ex.Message); throw ex;}

    3. catch{LogException(ex.Message); throw new Exception();}

    4. catch{LogException(ex.Message); rethrow;}

  2. You have created an application where you have implemented custom exception types and have also implemented multiple log methods, as follows:
public class CustomException1 : System.Exception{}public class CustomException2 : CustomException1 {}public class CustomException3 : CustomException1{} ...

Get Programming in C#: Exam 70-483 (MCSD) Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.