Created
October 24, 2023 15:15
-
-
Save adamstirtan/3d5498df148c2e9710308ae167d00ff4 to your computer and use it in GitHub Desktop.
Design flaws in error handling for code review
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| try | |
| { | |
| int[] numbers = new int[5]; | |
| int value = numbers[10]; | |
| Console.WriteLine("Value: " + value); | |
| } | |
| catch (Exception ex) | |
| { | |
| Console.WriteLine("An error occurred: " + ex.Message); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment