History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-907
Type: Task Task
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Marcus Griep
Reporter: Marcus Griep
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

Strings raised as exceptions should not raise ApplicationException

Created: 26/Oct/07 11:14 AM   Updated: 26/Oct/07 12:53 PM
Component/s: Compiler
Affects Version/s: 0.8
Fix Version/s: 0.8.1

Time Tracking:
Not Specified

File Attachments: 1. Text File stringwrappedexcept.patch (2 kb)



 Description  « Hide
See http://blogs.msdn.com/fxcop/archive/2006/04/05/faq-why-do-some-sources-recommend-extending-applicationexception-while-fxcop-does-not-michael-fanning-david-kean.aspx.

The use of ApplicationException, while not depreciated, is not recommended. As such, raised strings should be wrapped in an Exception instead to keep in compliance with FXCop recommendations: DoNotRaiseReservedExceptionTypes and TypesShouldNotExtendCertainBaseTypes

If the user chooses to raise a string, then it will still fail DoNotRaiseReservedExceptionTypes due to the Exception being thrown, though it is more in compliance with moving away from ApplicationExceptions



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Rodrigo B. de Oliveira - 26/Oct/07 11:20 AM
+1

Marcus Griep - 26/Oct/07 12:49 PM
Patch with corrected test.

Rodrigo B. de Oliveira - 26/Oct/07 12:53 PM
Perfect. Feel free to check it in.

Marcus Griep - 26/Oct/07 12:53 PM
Revision 2741