If I have a multi-layer Winform app with a Presentation, Business and Data Layer for example, and I encounter an error in either the Business Layer or Data Layer for which the only logical action is to log the error and inform the user that an error has occurred where should the logging take place?
Should I put the the methods in the Business and Data Layers in try catch blocks like so
try
{
DoSomethingThatMightGiveErrors();
}
catch(Exception ex)
{
logger.log(ex.ToString());
throw;
}
Or should I just let the errors bubble up to the presentation layer and handle the logging and informing the user there?