The example cited is one of situation. Situational irony occurs when actions have an effect that is directly contrary to what is intended. Often people allude to a "strange coincidence" when something such as the boy experiences occurs.
Irony happens when you expect one outcome but get another. An example of irony in literature is when Madame Loisel thinks the necklace she lost was worth a lot of money. As it turns out, she replaced a fake necklace with a real one. The irony is that she paid a fortune for a replacement of a inexpensive necklace.
Irony often occurs when the expected outcome is the opposite of what one hoped for; or you do get what you were hoping for, but in a way that is completely unusable or unpleasant. For example, I had hoped for a nice light rain to water my new flowers, but instead the torrential down pour completely flattened them. Ah, irony!
Situational irony is sometimes defined as occuring when the outcome of a situation or choice yields the opposite of the intended outcome.
The irony then comes in the contrast of what was expected and what actually happens.