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

  • Home
  • SEARCH
  • 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 128955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:43:02+00:00 2026-05-11T05:43:02+00:00

some friends just finished the implementation of an app and they use Custom Exceptions.

  • 0

some friends just finished the implementation of an app and they use Custom Exceptions. something that took my attention is that when a custom exception was raised they logged the exception in the code of the exception base class they implemented. so my question will be is this a good design approach?. my thinking is that a logging helper is more usable

 public class BaseCustomException: System.Exception {     public BaseCustomException()    {               TightlyCoupledClass.Log(this);    }  } 
  • 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. 2026-05-11T05:43:03+00:00Added an answer on May 11, 2026 at 5:43 am

    I understand their thinking in putting this into place so that they can assure that logging happens whenever an exception of CustomException is thrown; however, this is definitely smelly code.

    An exception should be used just for exceptions and the code that executes the code that could cause a CustomException to be thrown should be able to decide what to do with that exception and whether or not to log it… because the logging should be specific to the scenario in which it was caused.

    A side note, custom exceptions should inherit from ApplicationException as a root so that you can tell if the exception is custom to your business libraries or from the .NET framework itself.
    –CORRECTION– I just found this post that I was not aware of that essentially renders using ApplicationException useless.

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

Sidebar

Related Questions

I am setting up a rails app and I just finished making some unit
friends I was just playing around with some pointer programs and realized that the
Recently I just finished a simple Facebook Air application, and some of my friends
I was having a discussion with some programmer friends who said that they see
I'm working on a C project with some friends for school. They helped me
I'm actually creating websites for fun and some of my friends told me that
I'm developing a web app. I'd like to be able to let some friends
In my current .NET and FBML-based facebook app, I have some code that looks
I have noticed that some apps have a distinction between 'Invites from friends' vs
I'm just writing a simple bot for me and my friends to use on

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.