Skip to content

Instantly share code, notes, and snippets.

@adamstirtan
Created October 24, 2023 15:15
Show Gist options
  • Select an option

  • Save adamstirtan/3d5498df148c2e9710308ae167d00ff4 to your computer and use it in GitHub Desktop.

Select an option

Save adamstirtan/3d5498df148c2e9710308ae167d00ff4 to your computer and use it in GitHub Desktop.
Design flaws in error handling for code review
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