Open Joooooooosh88 opened 1 year ago
It's not only Rate Limit, I got more errors for example: Status: True Response: <Response [200]> Content: b'Webhook message delivery failed with error: Microsoft Teams endpoint returned HTTP error 500 with ContextId...'
Status: True Response: <Response [200]> Content: b'System.Net.Http.HttpRequestException: Error while copying content to a stream.'
Describe the bug MS Teams rate limiting is not handled well and does not raise an exception. MS unfortunately chose to respond to rate limited requests with a 200 status code, only including the 429 error in the response body. It would be fantastic if this library would raise a TeamsWebhookException if a 429 error is found in the response body, help avoid the trap I'm sure a lot of people fall into, assuming MS would pick sensible response codes.
To Reproduce Steps to reproduce the behaviour:
Expected behavior MS choosing to respond with a 200 is unfortunate and non-sensical but something I'd hope a library like this would account for.