static int GetValueFromArray(int[] array, int index)
{
    try
    {
        return array[index];
    }
    catch (System.IndexOutOfRangeException ex)
    {
System.ArgumentException argEx = new System.ArgumentException("Id out of range", "index", ex);
throw argEx;
    }
}