Answer
Before building this, weigh the actual cost-benefit: an automated restart-on-error event for a genuinely intermittent failure (one that doesn't reliably reproduce on demand) is often more effort to build and properly test than it's worth compared to simply monitoring the print queue and restarting failed jobs manually in the meantime. Since the underlying error doesn't always occur, thoroughly testing that the automated restart logic actually works correctly across the different ways the failure can manifest tends to be the most time-consuming part of building something like this — for a genuinely intermittent, still-being-investigated issue, manual monitoring and restarting is often the more practical near-term approach, reserving the automation effort for after the underlying root cause is better understood.