You should find it under..

ms-help://MS.VSCC/MS.MSDNQTR.2002APR.1033/cpgenref/html/cpconerrorraisinghan
dlingguidelines.htm

which is under .Net Framework/Reference/Design Guidelines for Class Library
Developers.

I don't know about anyone else but I'm having great difficulty with the new
contents organisation of the MSDN library. It's difficult to find stuff and
a lot isn't even linked - I hope MS sort it for the July release.

Graham

-----Original Message-----
From: Sam Gentile [mailto:[EMAIL PROTECTED]]
Sent: 28 May 2002 22:23
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET] Need a good real-world C# Exceptions Resource or
Stategy for Library


Thanks that helps. Where in the SDK are these guidelines?


>From: Graeme Foster <[EMAIL PROTECTED]>
>Reply-To: dotnet discussion <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: [DOTNET] Need a good real-world C# Exceptions Resource or
>         Stategy for              Library
>Date: Tue, 28 May 2002 21:51:12 +0100
>
>Hi Sam,
>
>In your example, I'd say it doesn't make much sense to let the
>ArgumentNullException out unless the null argument originated outside of
>your library, in which case you'd probably want to catch the exception
>and throw a new ArgumentNullException describing the argument from the
>callers perspective. Otherwise you'd need to catch it and throw a
>different exception as you say... The guidelines in the SDK (worth a
>read) suggest that you only define your own ApplicationException-derived
>classes when you think the caller may need to catch that particular
>exception, otherwise you can just throw an ApplicationException.
>
>I suppose the trick is to look at your library from the caller's point
>of view. What exceptions would you expect, and what exceptions would you
>find useful? If you let an exception out that doesn't tell the caller
>anything useful, then it's probably not the right exception to be
>letting out. At the very least, throw an ApplicationException with a
>useful message (the inner exception also proves handy here).
>
>HTH,
>G.
>
>
>-----Original Message-----
>From: dotnet discussion [mailto:[EMAIL PROTECTED]] On Behalf Of
>Sam Gentile
>Sent: 28 May 2002 20:38
>To: [EMAIL PROTECTED]
>Subject: Need a good real-world C# Exceptions Resource or Stategy for
>Library
>
>
>I have just been poring through C# books and no one seems to address
>this
>well. Sure, otherwise great books like Jesse Liberty's "Progarmming C#"
>talk
>about Exceptions but all the examples are too trivial. The examples just
>shoot out an "I am here" kind of thing in the catch handler. Actually
>some
>C# books don't even discuss it!! I need something more.
>
>Lets suppose I am/have creating a C# library of classes in a namespace.
>I
>want to put in full exception handling. I have some circumstances where
>I am
>creating files and reading them with System.IO classes, I am doing a lot
>of
>things with System.Xml. The thing is that I want to define and implement
>a
>sound exception processing strategy. Obviously, I don't really want to
>handle exceptions in a library by putting up
>System.Console.WriteLine("Can't
>open file"). I want to throw them up to the caller, but what? Suppose I
>catch an ArgumentNullException on a FileStream constructiuon. Does it
>make
>sense to define my custom exceptions and throw those up? Are there any
>good
>C# resources that show real exception processing/good pratices?
>
>You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
>subscribe to other DevelopMentor lists at http://discuss.develop.com.




---------------------
Sam Gentile
.NET Consultant
Co-author: Wrox Visual C++ .NET: A primer for C++ developers
BLOG: http://radio.weblogs.com/0105852/
http://www.project-inspiration.com/sgentile/DotNet.htm
http://www.project-inspiration.com/sgentile/
---------------------------




_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to