I am coding a rogue-like console program but I have a question:

My code does not catch an exception. I have a `void` with `for` loops and `arrays`.
The error happens when the array is out of range. This happens because the void doesn't check if the array is bellow zero or over the maximum.

```
    void lightUp(int pos)
    {
        //first and second
        for (int i = 1; i > -2; i--)
        {
            int lolPos = pos + (i * columns);
            for (int j = 0; j < 8; j++)
            {
                tiles[lolPos + j].isVisible = true;
                tiles[lolPos - j].isVisible = true;
            }
        }

        //third
        for (int i = 2; i > -3; i -= 4)
        {
            int lolPos = pos + (i * columns);
            for (int j = 0; j < 7; j++)
            {
                tiles[lolPos + j].isVisible = true;
                tiles[lolPos - j].isVisible = true;
            }
        }

        //fourth
        for (int i = 3; i > -4; i -= 6)
        {
            int lolPos = pos + (i * columns);
            for (int j = 0; j < 6; j++)
            {
                tiles[lolPos + j].isVisible = true;
                tiles[lolPos - j].isVisible = true;
            }
        }

        //fifth
        for (int i = 4; i > -5; i -= 8)
        {
            int lolPos = pos + (i * columns);
            for (int j = 0; j < 5; j++)
            {
                tiles[lolPos + j].isVisible = true;
                tiles[lolPos - j].isVisible = true;
            }
        }

        for (int i = 5; i > -6; i -= 10)
        {
            int lolPos = pos + (i * columns);
            for (int j = 0; j < 3; j++)
            {
                tiles[lolPos + j].isVisible = true;
                tiles[lolPos - j].isVisible = true;
            }
        }
    }

```

So I made a catch block, in case the error happens my progam does not crash.

```
            try
            {
                lightUp(player);
            }
            catch { }

```

But, I am still getting `IndexOutOfRange` exceptions. They get not trapped by the `catch` block.
Why is that?

EDIT:
Thanks for all the answers. Thought, the problem does not lie in the debug mode options.
I figured out that this only happens **when the program starts.** I tested if I just walk to "out of range" (The void lights-up the tiles near the player), the catch block does actually work. But not when I start my program.(The position of the player is random, if it is near the side of the left screen, the exception happens at startup.) 

ANOTHER EDIT: I fixed the "magic numbers"(not bellow zero and not over the maximum),
and that will always work, no matter what happens to it.