Retry quantum errors

This is kind of ugly.  Is there a better way?