Skip to content

fix: fix JSONDEcodeError exception #202

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

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

etiennevincent
Copy link
Contributor

/home/vscode/.local/lib/python3.10/site-packages/grafana_client/elements/folder.py:87: in delete_folder
    return self.client.DELETE(path)
/home/vscode/.local/lib/python3.10/site-packages/grafana_client/client.py:218: in __request_runner
    return self._extract_from_response(r, accept_empty_json)
/home/vscode/.local/lib/python3.10/site-packages/grafana_client/client.py:187: in _extract_from_response
    return r.json()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Response HTTP/1.1 [200]>, kwargs = {}

    def json(self, **kwargs: typing.Any) -> typing.Any:
        r"""Returns the json-encoded content of a response, if any.
    
        :param \*\*kwargs: Optional arguments that ``json.loads`` takes.
        :raises requests.exceptions.JSONDecodeError: If the response body does not
            contain valid json or if content-type is not about json.
        """
    
        if (
            not self.content
            or "json" not in self.headers.get("content-type", "").lower()
        ):
>           raise RequestsJSONDecodeError(
                "response content is not JSON", self.text or "", 0
            )
E           niquests.exceptions.JSONDecodeError: response content is not JSON: line 1 column 1 (char 0)

/home/vscode/.local/lib/python3.10/site-packages/niquests/models.py:1513: JSONDecodeError

Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.29%. Comparing base (5ab7592) to head (6e485dd).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #202   +/-   ##
=======================================
  Coverage   92.29%   92.29%           
=======================================
  Files          27       27           
  Lines        1816     1816           
=======================================
  Hits         1676     1676           
  Misses        140      140           
Flag Coverage Δ
unittests 92.29% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@amotl amotl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@amotl amotl merged commit 73182d2 into grafana-toolbox:main Jan 10, 2025
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants