C#: exception filter - by arghhhhhhhhhhh

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


1
0
Sign in
to vote
ID 401668 Comments
Status Closed Workarounds
Type Suggestion Repros 0
Opened 1/18/2009 5:09:39 PM
Access Restriction Public

Description

When you have multiple exception types that you handle the same way, you must either duplicate the exception logic in every block OR create a method to handle the exception(s).
Sign in to post a comment.
Posted by Microsoft on 1/22/2009 at 2:13 PM
Thanks for your suggestion.

The current behavior is by design. If you want to filter your exceptions programmatically, and handle them similarly, I suggest that you catch Exception itself and put all the logic in the body of that catch clause.

Thanks again,

Mads Torgersen, C# Language PM