Move into the if block a few lines up? HasCaught() can only return true after a function call.