Re: How to extract all exceptions for any method
- From: paul <paul@xxxxxxxxxx>
- Date: Tue, 15 Apr 2008 17:32:48 -0700 (PDT)
On Apr 16, 7:12 am, "Peter Duniho" <NpOeStPe...@xxxxxxxxxxxxxxxx>
wrote:
On Tue, 15 Apr 2008 14:01:47 -0700, paul <p...@xxxxxxxxxx> wrote:
I am pretty sure this can be done as Visual Studio 2005 already tells
you the specific Exceptions that can be generated by a single method.
I'm not aware of any feature in VS that does this generally. It's true
that the documentation for much of .NET includes information as to which
exceptions may be thrown, and inasmuch as VS shows you that documentation,
it will show you those specific exceptions.
If you know of something more specific than that, perhaps you could
provide more details regarding what you're seeing in VS.
Also Red-Gate Exception hunter validates your code and highlights all
possible exceptions (part from generic exception).
I'm not familiar with that tool. However, it's plainly false that it
"highlights all possible exceptions". No doubt it does a good job
traversing the call chain (something that's easily done via reflection),
looking for code that creates and throws exceptions. But it's simply not
possible to find literally all possible exceptions.
As Marc already asked, was there some specific situation or scenario
you're trying to address? Generally speaking, if it's possible for a
method to throw some exception that can be usefully dealt with, it will be
documented by the author of that method. Other kinds of exceptions that
might be thrown wouldn't be relevant information anyway, by definition.
Pete
Hi
This is possible and it's standard in VS Studio 2005 (C#).
Hover your mouse over a method (e.g. System.IO.File.Open) and wait for
the little popup window, here lists all known exceptions (again part
from generic exceptions), so it is possible.
Paul
.
- Follow-Ups:
- Re: How to extract all exceptions for any method
- From: Peter Duniho
- Re: How to extract all exceptions for any method
- References:
- How to extract all exceptions for any method
- From: paul
- Re: How to extract all exceptions for any method
- From: Marc Gravell
- Re: How to extract all exceptions for any method
- From: paul
- Re: How to extract all exceptions for any method
- From: Peter Duniho
- How to extract all exceptions for any method
- Prev by Date: Re: protecting objects from being changed
- Next by Date: Re: Operator ?
- Previous by thread: Re: How to extract all exceptions for any method
- Next by thread: Re: How to extract all exceptions for any method
- Index(es):
Relevant Pages
|