Which approach should you recommend?

You are designing a SharePoint 2010 feature. The feature includes a feature receiver that
executes code on activation and deactivation. The feature receiver code interacts with a

Web service, which could cause errors beyond your control. You need to ensure that the
feature does not activate or deactivate if the Web service causes an error. Which approach
should you recommend?

You are designing a SharePoint 2010 feature. The feature includes a feature receiver that
executes code on activation and deactivation. The feature receiver code interacts with a

Web service, which could cause errors beyond your control. You need to ensure that the
feature does not activate or deactivate if the Web service causes an error. Which approach
should you recommend?

A.
Wrap your code in a try-catch block. Log the error and issue another request to the Web
service in the catch block

B.
Wrap your code in a try-catch block. Log the error and throw an exception in the catch
block.

C.
Wrap your code in a try-catch block. Only catch exceptions of type SPException.

D.
Wrap your code in a try-finally block. Log any issues your code encounters in the finally
block



Leave a Reply 0

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