Handle errors with validations.