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

Fix AttributeError on requests.exception.JSONDecodeError #392

Merged
merged 5 commits into from
Nov 13, 2024
Merged

Conversation

rezib
Copy link
Contributor

@rezib rezib commented Nov 13, 2024

  • Refactor mock_agent_response and mock_prometheus_response

fix #391

Following metrics boolean field addition in 15544df, update agent info
asset to matchnew responses from agent.
@rezib rezib added this to the v4.0.0 milestone Nov 13, 2024
@rezib rezib added the bug This was supposed to work in this case and clearly it is not. label Nov 13, 2024
@rezib rezib self-assigned this Nov 13, 2024
Catch generic requests.exceptions.RequestException on information
retrieval from agents to avoid AttributeError with more specific
exceptions on old versions on Requests library.

fix #391
Catch JSONDecodeError from simpleson external library and json
standard library module, with the logic required with Requests < 2.27.
@rezib rezib merged commit 4d7238d into main Nov 13, 2024
9 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2024
@rezib rezib deleted the pr/fix-391 branch November 15, 2024 17:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This was supposed to work in this case and clearly it is not.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError: module 'requests.exceptions' has no attribute 'JSONDecodeError' on Requests < 2.26
1 participant