What should you do?

You are an enterprise application developer. You are creating a component that encapsulates database access to an employee table. The component contains a method that retrieves an employee record by using a string input parameter.
You need to respond to error conditions in a way that meets the following requirements:

If the caller passes a variable that fails to reference a string object, the caller receives an error notice.
If the caller fails to respond to the error notice, the error condition forcefully alters the flow of execution.
If the error occurs on the main thread, the application is terminated.

What should you do?

You are an enterprise application developer. You are creating a component that encapsulates database access to an employee table. The component contains a method that retrieves an employee record by using a string input parameter.
You need to respond to error conditions in a way that meets the following requirements:

If the caller passes a variable that fails to reference a string object, the caller receives an error notice.
If the caller fails to respond to the error notice, the error condition forcefully alters the flow of execution.
If the error occurs on the main thread, the application is terminated.

What should you do?

A.
Invoke the Interrupt method of the current thread.

B.
Return a Boolean value of False from the method.

C.
Raise a ValidationError event.

D.
Throw an ArgumentNullException exception.



Leave a Reply 0

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