Requests can internally raise a RetryError:
requests.exceptions.RetryError: HTTPSConnectionPool(host='XXX.sap.hana.ondemand.com', port=443): Max retries exceeded with url: /data-manager/api/v3/datasets (Caused by ResponseError('too many 500 error responses'))
This should be handled similar to the existing handling for HTTP error codes; i.e. raise an exception which includes request details.