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 8669075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:22:49+00:00 2026-06-12T18:22:49+00:00

Is the following good practice and if not what should be done? catch(Exception e)

  • 0

Is the following good practice and if not what should be done?

catch(Exception e)
{
     throw new Exception(e.Message, e);
}
  • 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-06-12T18:22:50+00:00Added an answer on June 12, 2026 at 6:22 pm

    No, this is not good practice if you’re throwing another exception of the exact same type with the same message. In doing this, you complicate the stack trace and make debugging more of a pain.

    If you’re going to throw a new exception, it should differ from the original in some significant way. It should be another type, for example, or in some other way (like a more specific error message) clarify the reason for the exception. If you can’t do either of those things, then simply rethrow the current exception using throw;.

    Or, even better, don’t catch it at all. Rethrowing actually messes up the stack trace a tiny bit as well (the current frame’s error location is set to the rethrow point rather than the spot where the exception happened), so if you don’t have anything you personally have to do to handle the exception, then hands off — just let it propagate and let the caller handle it.

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

Sidebar

Related Questions

Just wondering if the following is considered to be good programming practice or not?
Is the following not a good practice? public interface IMyImmutableData { int Data {
How might one craft a good explanation of why the following code is not
I know destructor shouldn't not throw exception. http://www.parashift.com/c++-faq-lite/dtors.html#faq-11.13 I have the following code :
Despite the fact that this is not good coding practice, I want a macro
I am new to OOP and hence, am looking for suggestions on good practice
Following the good jQuery Plugins/Authoring instructions I have a little question (function($){ // Default
The following page looks good in Firefox, Safari, Chrome, IE6 and IE8... but it
I'm using with good results the following code to access alla of my php
Is there a good way in C# to mimic the following python syntax: mydict

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.