Update retryhandler to handle change in error response structures

Updated unit tests as well.

cc @kyleknap @danielgtaylor