Saving good records in a multi line form when error

Hello,
in a multi-line form, how to keep the correct records and reset the bad records to a user encoding error, because when encoding errors occur all the rows return to their default value