Error is only checked after the for loop. What about checkint for it on each iteration and bailing early if so?