Restart bash if there are any errors

How is this for a workaround?
How about pexpect.TIMEOUT?