Skip to content

Commit 986be6a

Browse files
rcseacordBillWagner
authored andcommitted
Update exception-handling_4.cs (#1356)
Not good to have broken examples This code generates a CS0168 error because e is not used. You should definitely use it to set IndexOutOfRangeException to the new exception's InnerException. You do this correctly in the topic "How to: Handle an Exception Using try/catch (C# Programming Guide)"
1 parent c81b3b4 commit 986be6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/csharp/programming-guide/exceptions/codesnippet/CSharp/exception-handling_4.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ int GetInt(int[] array, int index)
77
catch(System.IndexOutOfRangeException e)
88
{
99
throw new System.ArgumentOutOfRangeException(
10-
"Parameter index is out of range.");
10+
"Parameter index is out of range.", e);
1111
}
12-
}
12+
}

0 commit comments

Comments
 (0)