Validating Smiles

Can i know how to validate smiles before attempting to convert them in to structure. My protocol is halting at "Molecule to smiles" component as the smiles are not valid for that record. I have large data where in i cannot keep correcting each and individual record. I would like the failed data to go into separate(failed) port and the rest to continue.