Azure / azure-ruby-asm-core

Azure Ruby SDK Service Management Core HTTP
6 stars 32 forks source link

Retry_Policy Re-throws Response Errors #51

Closed maham-nazir closed 6 years ago

maham-nazir commented 6 years ago

I am using azure-core in the fog-azure-rm library. I am making two calls, first is get and the next one is put. For the first get call, the response is an error which is as expected. This error is stored inside @retry_data in retry_policy.rb and is raised. When the next put call is sent, @retry_data still contains the error data and once again the error gets raised even though the response of the 'put' call is a success. The error happens at this point => https://github.com/Azure/azure-ruby-asm-core/blob/c7f97f8ad46a7be1e9c71c23802c56cb4404047d/lib/azure/core/http/retry_policy.rb#L51 Shouldn't the error be raised like this?

if response && !response.success?
      @retry_data[:error] = response.error
      raise @retry_data[:error]
else
      response
end

Please provide an explanation for this, thank you.

maham-nazir-confiz commented 6 years ago

@yaxia Hello, can you please tell me when will the new gem version (0.1.14) be released?

yaxia commented 6 years ago

The new version (0.1.14) is released. Please try. Thanks.