Part of the specification is to check the full validation scope for errors. Basically, you want to respond with as many errors as possible to the user, so he can fix them all in one go, rather than having to go through multiple.
If you particularly want to do as you say, your code seems fine to me, except I would probably use
if (!error.isEmpty()) return error;
instead.