BL Touch leveling error help with code please

#1
Does anyone know if there is a line of code I can enter for when the BL Touch is doing the 9 point leveling and fails? Currently, if it fails, it keeps the probe down, moves all the way to the left, and starts printing with the BL touch flashing red. 2 problems with this:
1. it is printing when the leveling failed and
2. It keeps the probe down so that once it starts moving back to the right for printing, it bends my probe and ruins it.

I would love to put a code in to either stop the print if levelling fails or at least retract the probe if it fails.

Thank you in advance.