Easiest method is:
1) If any filled, and at least one failed, cancel all pending orders and neutralize net position on the rest.
2) In addition to the above, it would probably be smart to send an email to yourself in the case of fill failures so that you can clean up. I hadn’t done this before but the “emailR” R package looks like an easy way to implement this.