koalalorenzo / python-digitalocean

🐍🐳 Python module to manage Digital Ocean droplets
GNU Lesser General Public License v3.0
1.25k stars 300 forks source link

extract ratelimit headers even in case of errors #365

Open rienafairefr opened 1 year ago

rienafairefr commented 1 year ago

I was getting DataReadErrors like these in the logs, with no way to get the info from the library about the ratelimit headers once the exception is raised

digitalocean.DataReadError: error resizing volume: rate limited

I've move the ratelimit headers extraction the content processing in get_data, which makes the rate limit info available even in case of a response error from digitalocean.