Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 536509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:49:45+00:00 2026-05-13T09:49:45+00:00

If I have a multi-layer Winform app with a Presentation, Business and Data Layer

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:49:45+00:00Added an answer on May 13, 2026 at 9:49 am

    I’d put the logging at the business layer level and then rethrow the error. If this layer is used in another project in the future, it’s already doing the logging. Rethrowing the exception allows consumers of this layer to convert the error into a friendly message.

    EDIT: I think it depends a bit on the kind of logging: if you’re logging to a central database, which is independent from the UI, put the logging in the business logic layer. If the logging is specific to the UI, for example writing a log file to the application’s directory, put it in the UI.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multi-tiered app with a data layer containing repositories. On top of
I have a layered application in Java which has a multi thread data access
I have a multi-array stored in a SESSION I loop through the data in
We have a typical multi-tier/layer architecture. Application + WCF Service + Repository/EF4/Database. We are
I suppose most of the developers have an idea of multi-layer architecture. We have
I have a multi-layered PSD, with one specific layer being non-rasterized text. I'm trying
I have a multi-layer neural network based estimator that takes inputs the past arrival
I created a multi-layer project, structured like this UI Application Domain Infrastructure I have
I have a class called 'Article' in a project called 'MyProject.Data', which acts as
I have a maven multi-module project. project-services (service layer..above the dao layer) project-controller (My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.