Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error messages get swallowed #28

Open
matthias-mess opened this issue Jul 22, 2020 · 0 comments
Open

error messages get swallowed #28

matthias-mess opened this issue Jul 22, 2020 · 0 comments

Comments

@matthias-mess
Copy link

matthias-mess commented Jul 22, 2020

r = self._doRequest(url, method, body, headers)
retry_http_codes = [503, 504]
if r.status_code in retry_http_codes and retry:
tries = 5
delay = .5
backoff = 2
while r.status_code in retry_http_codes and tries > 0:
tries -= 1
time.sleep(delay)
delay *= backoff
r = self._doRequest(url, method, body, headers)
r.raise_for_status()

The actual error message is in response.text and can't be accessed after the raise_for_status anymore. It's hard to know on application level what went wrong if the error is just "400 bad request". It would be good if the actual error message would be part of the exception message.

After hacking the library I found out that I actually got the error message {"msg":"Message must be no more than 64k"} from ironmq. I was spending have the day searching why my request is not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant