DRAG DROP

DRAG DROP
You are developing an application that implements a set of custom exception types. You declare the custom exception types by using the following code segments:


The application includes a function named DoWork that throws .NET Framework exceptions and custom exceptions. The application contains only the following logging methods:


The application must meet the following requirements:
When ContosoValidationException exceptions are caught, log the information by using the static void Log (ContosoValidationException ex) method.
When ContosoDbException or other ContosoException exceptions are caught, log the information by using the static void Log(ContosoException ex) method.
You need to meet the requirements.
You have the following code:


Which code segments should you include in Target 1, Target 2 and Target 3 to complete the code? (To answer, drag the appropriate code segments to the correct targets in the answer area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
Select and Place:


microsoft-exams

5 thoughts on “DRAG DROP

  1. In the questions there is a mention about catching both the ContosoDbException as well as the ConstosoException static void Log(ContosoException ex) method.

    “When ContosoDbException or other ContosoException exceptions are caught, log the information by using the static void Log(ContosoException ex) method. ”

    So both the DB related exception and the other ContosoExceptions other than the validation can be caught using the ContosoException.

    The rest other generic system exception can be caught using the System.Exception. So as per the order is

    1.ContosoValidationException ex
    2.ContosoException ex
    3.Exception ex

  2. Correct :
    ContosoValidationException(ex)
    ContosoDbException (ex)
    ContosoException(ex)

    Do not answer what you want but what the statement asks.
    It does not ask to catch Exception

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.