How should you complete the relevant code?

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.
How should you complete the relevant code? (To answer, drag the appropriate code segments to
the correct locations in the answer are
a 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.)

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.
How should you complete the relevant code? (To answer, drag the appropriate code segments to
the correct locations in the answer are
a 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.)

Answer:



Leave a Reply 3

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


caret

caret

Same as #30

Lord Vader

Lord Vader

contosodbexception is more specific than contosoexception so it should typically appear earlier

but ” When ContosoDbException or other ContosoException exceptions are caught, log the information by
using the static void Log(ContosoException ex) method.” so we omit contosodbexception from the catch statements