<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>FAQ: What exception should I throw instead of the reserved exceptions that DoNotRaiseReservedExceptionTypes warns against?</title><link>http://blogs.msdn.com/fxcop/archive/2007/01/22/faq-what-exception-should-i-throw-instead-of-the-reserved-exceptions-found-by-donotraisereservedexceptiontypes.aspx</link><description>Throwing a general exception type such as System.Exception or System.SystemException in a library or Framework forces consumers to catch all exceptions, including unknown exceptions that they do not know how to handle (see FAQ: Why does FxCop warn against</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: FAQ: What exception should I throw instead of the reserved exceptions that DoNotRaiseReservedExceptionTypes warns against?</title><link>http://blogs.msdn.com/fxcop/archive/2007/01/22/faq-what-exception-should-i-throw-instead-of-the-reserved-exceptions-found-by-donotraisereservedexceptiontypes.aspx#1513626</link><pubDate>Tue, 23 Jan 2007 14:16:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1513626</guid><dc:creator>PeterI</dc:creator><description>&lt;p&gt;Hmm I'm not sure I understand the IndexOutOfRange one, it seems like a perfect match (or is this a case where matching the rest of the framework is better)&lt;/p&gt;
</description></item><item><title>re: FAQ: What exception should I throw instead of the reserved exceptions that DoNotRaiseReservedExceptionTypes warns against?</title><link>http://blogs.msdn.com/fxcop/archive/2007/01/22/faq-what-exception-should-i-throw-instead-of-the-reserved-exceptions-found-by-donotraisereservedexceptiontypes.aspx#1514363</link><pubDate>Tue, 23 Jan 2007 17:05:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1514363</guid><dc:creator>Jarle Nygård</dc:creator><description>&lt;p&gt;Nice! Thnx for this! :)&lt;/p&gt;</description></item><item><title>re: FAQ: What exception should I throw instead of the reserved exceptions that DoNotRaiseReservedExceptionTypes warns against?</title><link>http://blogs.msdn.com/fxcop/archive/2007/01/22/faq-what-exception-should-i-throw-instead-of-the-reserved-exceptions-found-by-donotraisereservedexceptiontypes.aspx#1514717</link><pubDate>Tue, 23 Jan 2007 18:34:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1514717</guid><dc:creator>David M. Kean</dc:creator><description>&lt;P&gt;IndexOutOfRangeException is an exception that&amp;nbsp;should be only thrown by the&amp;nbsp;runtime when an index used to access an&amp;nbsp;element is outside of&amp;nbsp;the bounds of the array. To be consistent with the other .NET Framework classes (such as ArrayList, List&amp;lt;T&amp;gt;, Collection&amp;lt;T&amp;gt;, etc), you should throw ArgumentOutOfRangeException. &lt;/P&gt;</description></item><item><title>Wondering which exception type to throw?</title><link>http://blogs.msdn.com/fxcop/archive/2007/01/22/faq-what-exception-should-i-throw-instead-of-the-reserved-exceptions-found-by-donotraisereservedexceptiontypes.aspx#1518643</link><pubDate>Wed, 24 Jan 2007 04:44:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1518643</guid><dc:creator>Jeff Stong</dc:creator><description>&lt;p&gt;Wondering which exception type to throw rather than the too general System.Exception? Find some...&lt;/p&gt;
</description></item><item><title>re: FAQ: What exception should I throw instead of the reserved exceptions that DoNotRaiseReservedExceptionTypes warns against?</title><link>http://blogs.msdn.com/fxcop/archive/2007/01/22/faq-what-exception-should-i-throw-instead-of-the-reserved-exceptions-found-by-donotraisereservedexceptiontypes.aspx#1522278</link><pubDate>Wed, 24 Jan 2007 19:34:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1522278</guid><dc:creator>PeterI</dc:creator><description>&lt;p&gt;Thanks for that, perhaps you should kick the MSDN doc folks and get that stuck on the documentation page.&lt;/p&gt;
</description></item><item><title>re: FAQ: What exception should I throw instead of the reserved exceptions that DoNotRaiseReservedExceptionTypes warns against?</title><link>http://blogs.msdn.com/fxcop/archive/2007/01/22/faq-what-exception-should-i-throw-instead-of-the-reserved-exceptions-found-by-donotraisereservedexceptiontypes.aspx#1522512</link><pubDate>Wed, 24 Jan 2007 20:08:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1522512</guid><dc:creator>David M. Kean</dc:creator><description>&lt;p&gt;Peter,&lt;/p&gt;
&lt;p&gt;Thanks for the suggestion. We're working at the moment on making the docs better - expect to see information such as above, included for Orcas.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;
</description></item><item><title>re: FAQ: What exception should I throw instead of the reserved exceptions that DoNotRaiseReservedExceptionTypes warns against?</title><link>http://blogs.msdn.com/fxcop/archive/2007/01/22/faq-what-exception-should-i-throw-instead-of-the-reserved-exceptions-found-by-donotraisereservedexceptiontypes.aspx#1523775</link><pubDate>Thu, 25 Jan 2007 00:47:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1523775</guid><dc:creator>Kevin Westhead</dc:creator><description>&lt;p&gt;Shouldn't it be ArgumentOutOfRangeException for enums as well? This was mentioned in the comments of an earlier Enum design guideline (see &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/kcwalina/archive/2004/05/18/134208.aspx"&gt;http://blogs.msdn.com/kcwalina/archive/2004/05/18/134208.aspx&lt;/a&gt;), but perhaps best practice has changed since then? It certainly seems like most APIs outside of Windows Forms use ArgumentOutOfRangeException.&lt;/p&gt;
</description></item><item><title>re: FAQ: What exception should I throw instead of the reserved exceptions that DoNotRaiseReservedExceptionTypes warns against?</title><link>http://blogs.msdn.com/fxcop/archive/2007/01/22/faq-what-exception-should-i-throw-instead-of-the-reserved-exceptions-found-by-donotraisereservedexceptiontypes.aspx#1523908</link><pubDate>Thu, 25 Jan 2007 01:33:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1523908</guid><dc:creator>David M. Kean</dc:creator><description>&lt;P&gt;Kevin,&lt;/P&gt;
&lt;P&gt;Good spotting. However, if you look at Brad's annotation further down the page you will see that he is throwing an InvalidEnumArgumentException.&lt;/P&gt;
&lt;P&gt;I've actually explained the reason behind these contradictions in a Community content block at the bottom of the docs on InvalidEnumArgumentException, which I will re-post here:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Unfortunately, as InvalidEnumArgumentException is defined in System.dll and not mscorlib.dll, the later does not throw it when an invalid enum argument is passed to a member, but instead throws ArgumentException or ArgumentOutOfRangeException. This inconsistancy however, usually does not present a problem, as this exception, when thrown, typically indicates a bug in the caller and is rarely caught within a catch clause.&lt;/EM&gt;&lt;/P&gt;</description></item><item><title>strange 'string' to Textbox conversion error, tips on Code Analysis, what exception to raise in your app</title><link>http://blogs.msdn.com/fxcop/archive/2007/01/22/faq-what-exception-should-i-throw-instead-of-the-reserved-exceptions-found-by-donotraisereservedexceptiontypes.aspx#1547549</link><pubDate>Sun, 28 Jan 2007 19:46:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1547549</guid><dc:creator>.NET 2.0</dc:creator><description>&lt;p&gt;The Confusing &amp;quot;Cannot implicitly convert type 'string' to 'System.Web.UI.WebControls.TextBox'&amp;quot; Compilation&lt;/p&gt;
</description></item><item><title>re: FAQ: What exception should I throw instead of the reserved exceptions that DoNotRaiseReservedExceptionTypes warns against?</title><link>http://blogs.msdn.com/fxcop/archive/2007/01/22/faq-what-exception-should-i-throw-instead-of-the-reserved-exceptions-found-by-donotraisereservedexceptiontypes.aspx#1555017</link><pubDate>Tue, 30 Jan 2007 06:18:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1555017</guid><dc:creator>Mitch Wheat</dc:creator><description>&lt;p&gt;Nice one David!&lt;/p&gt;</description></item><item><title>How to Design Exception Hierarchies</title><link>http://blogs.msdn.com/fxcop/archive/2007/01/22/faq-what-exception-should-i-throw-instead-of-the-reserved-exceptions-found-by-donotraisereservedexceptiontypes.aspx#1561630</link><pubDate>Wed, 31 Jan 2007 08:17:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1561630</guid><dc:creator>The Visual Studio Code Analysis Team Blog</dc:creator><description>&lt;p&gt;Krzysztof Cwalina, owner of the Framework Design Guidelines , has written a great post on How to Design&lt;/p&gt;</description></item><item><title>How to Create Custom Code Analysis Rules for VSTS 2005</title><link>http://blogs.msdn.com/fxcop/archive/2007/01/22/faq-what-exception-should-i-throw-instead-of-the-reserved-exceptions-found-by-donotraisereservedexceptiontypes.aspx#1671502</link><pubDate>Wed, 14 Feb 2007 00:52:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1671502</guid><dc:creator>Tim McCarthy's Blog</dc:creator><description /></item><item><title>How to Create Custom Code Analysis Rules for VSTS 2005</title><link>http://blogs.msdn.com/fxcop/archive/2007/01/22/faq-what-exception-should-i-throw-instead-of-the-reserved-exceptions-found-by-donotraisereservedexceptiontypes.aspx#1674306</link><pubDate>Wed, 14 Feb 2007 10:21:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1674306</guid><dc:creator>Tim McCarthy's Blog</dc:creator><description /></item><item><title>FxCop backlog themes: Exceptions</title><link>http://blogs.msdn.com/fxcop/archive/2007/01/22/faq-what-exception-should-i-throw-instead-of-the-reserved-exceptions-found-by-donotraisereservedexceptiontypes.aspx#2430594</link><pubDate>Sat, 05 May 2007 19:48:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2430594</guid><dc:creator>I may have joined the wrong side</dc:creator><description>&lt;p&gt;Since I started monitoring traffic on this blog a little more closely about a week ago, I had the unexpected&lt;/p&gt;
</description></item></channel></rss>