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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:38:57+00:00 2026-05-12T22:38:57+00:00

I read a lot about how bad catching base Exceptions is and I have

  • 0

I read a lot about how bad catching base Exceptions is and I have to confess that I did it also:

try{
    ...
}
catch (Exception exception){
    MessageBox.Show(exception.Message, "Error!");
    MyLogger.Log(exception.Message);
}

Now I would like to do it right and have some questions about it:

  1. Which exceptions should I catch (for example FileNotExists for file manipulation, but what for TableAdapter or ReportClass (CrystalReports))
  2. Where can I see a list of exceptions, that an objects can throw (for example TableAdapter)
  3. Where in Windows Forms Application can I set a static method, which will log any exception to a file for example
  4. Any other suggestions?
  • 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-12T22:38:58+00:00Added an answer on May 12, 2026 at 10:38 pm
    1. Catch whichever exceptions you can reasonably handle. For example, if you’re trying to open a file for writing, you should expect that maybe the file is marked read-only, so that would throw an exception. But in the same situation you wouldn’t try to catch a null argument exception, because that would be due to programmer error.

    2. They should be found in the function reference in MSDN (you’ll have to look it up on each one). For user-defined functions, you’ll have to go digging, unless there is additional documentation or summary commentary.

    3, 4. Consider using a logging library for .NET

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

Sidebar

Related Questions

I have read a lot that LISP can redefine syntax on the fly, presumably
I've read a lot about the pros and cons of sizing with either relative
I've read a lot recently about how writing multi-threaded apps is a huge pain
I've read a lot of people saying that some things shouldn't be written in
I have read a lot of popular standards manuals for open source PHP projects.
I have read a lot of articles on Dependency Injection as well as watched
So, I've read a lot about using ExtJS's fileuploadfield to submit a form via
I have been reading a lot about MVC these days and I think I
I've read a lot of vague things online about support of android apps on
I read somewhere once that the modulus operator is inefficient on small embedded devices

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.