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 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 about jquery and i have a simple webservice that
I have read a lot about this issue but mine still seems to be
Recently I have read a lot about different NoSQL databases and how they are
I've read a lot about building UI that supports multiple screen resolutions on android.
I have read a lot about soft deletes and archive and saw all the
I read a lot about handling rotation in android applications, but I still have
I read a lot about Animation pre Honeycomp, and that changes only take account
I have read a lot about Cache Oblivious Algorithms and Streaming trees etc. I
I have read a lot about accessing files in an iPhone app, but I
I have read a lot about projective geometry and cross ratio, but I don´t

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.