0

I know that this is redundant (per Why does resharper say 'Catch clause with single 'throw' statement is redundant'?).

try
{
    bla bla bla
}
catch
{
    throw
}

So, I'm going through the old Microsoft Membership and Role Provider code (made available since 2006 per http://weblogs.asp.net/scottgu/archive/2006/04/13/442772.aspx). And, low and behold, the code is chock full of this redundant code.

Was there a good reason?

Community
  • 1
  • 1
Bill Mild
  • 413
  • 1
  • 4
  • 14

2 Answers2

2

Microsoft's coding standards are not the same as Resharper's. Having redundant try/catch blocks isn't wrong, its just bad style. Much of the MS source code could have plenty of positive code standard changes (much of it lacks the use of var, for example).

Fourth
  • 9,163
  • 1
  • 23
  • 28
0

This is a lazy way to put a breakpoint on that throw line, without turning on any of the debugger features that break on all exceptions.

John Gardner
  • 24,225
  • 5
  • 58
  • 76