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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:24:59+00:00 2026-05-27T08:24:59+00:00

Are there techniques or third party tools that will generate warnings if code has

  • 0

Are there techniques or third party tools that will generate warnings if code has a potential of throwing an exception which is not wrapped in a try/catch block?

  • 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-27T08:25:00+00:00Added an answer on May 27, 2026 at 8:25 am

    I would suggest that you might be better off thinking about why code is generating exceptions, as opposed to simply and without further consideration demand that all code be wrapped in some try/catch/finally or another. (Incidentally, if this were possible, it would be trivial to make it go away – developers could just wrap the main entry point in a try/catch, and no more warnings).

    Code Contracts is a tool that won’t do what you’re asking for here, exactly, but it will help you reason about your code’s run time behavior at compile time via compiler warnings. This will tell you things like when a client call deferences a return value and the service method might return null. This is getting to the root of exception-causing behaviors rather than just demanding that you handle them. In this case, you have a bad programming assumption — you don’t want to catch this exception, you want to eliminate it by preventing it from happening in the first place.

    I would save exception handling for places where you’re dealing with externalities that are beyond your control (e.g. the user unplugs the network cable while your app is downloading a file). It sounds to me as if you’re looking for Java-style checked exceptions, which C# does not have. But, if you look at the method XML comments for external libraries, you can see what exceptions they might generate, and handle those specific cases. If you’re only really doing this for externalities (and using Code Contracts to manage internal assumptions), the amount of additional time spent won’t be much.

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

Sidebar

Related Questions

Let us say that I am accessing a third-party library, for which the documentation
There are many techniques to enforce strong passwords on website: Requesting that passwords pass
I am wondering if there are any techniques to identify a web crawler that
There are many usability evaluation techniques that have been developed over the history of
In SEO there are a few techniques that have been flagged that need to
Are there any techniques to optimize code in order to ensure lesser power consumption.Architecture
What are, exactly mixins? Are there any techniques to achieve that in c#?
Are there any techniques/proposals to enforce unique constraints? Yes, we can create key that's
Are there any techniques that allow for expressions in css3 statements? Frequently it is
Are there any techniques which are applied for transforming continuous data to discrete data?

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.