Return correct error message for invalid fields