Error Messaging

Mar 28, 2013 at 8:23 PM
Hi Serena,

I have two questions as below:

I noticed that the Expense Sample has Console.WriteLine(ex.Message) in the business components. But you use Execution Fault contracts in the Services calling these components.
Will these errors be captured by the Execution Fault contract since they will only be displayed on the server where the service is running, correct?

Do I have to change the components generated and replace all
throw new NotImplementedException("Exception handling not implemented.");
with a LOG4Net or something similar? What would you suggest?

Awaiting you reply,
Mar 29, 2013 at 1:16 AM

The Expense Sample was sort off focusing on console host first and therefore was coded to dump out messages to the console window. LASG was designed to be closer to real world application by using Web Host (IIS/WAS) and therefore, encourages more proper exception handling method.

The faultcontracts can be inspected on the client side. The code in the UIPC should do that. :)

As for implementing handling for your exceptions - Yup! You are required to implement them in whatever manner you need regardless of whatever logging framework you choose to use :) I have no specific recommendations because I just log stuff to a log file and sometimes, to the Windows Event Log. You may want to checkout the stuff provided by Enterprise Library to see if it fits your use?