Added support for socket error retries, handler for errors, passed result through even on error (so _retry information is accessible)