Skip to content

[BUG]:json.decoder.JSONDecodeError when the url is wrong #7

Description

@Bidaya0

File "", line 1, in
File "/home/bidaya0/.local/lib/python3.9/site-packages/dongtai_sdk/DongTai.py", line 23, in GetProjectList
repData = self.dongTaiApi.GetProjectList(page,pageSize,name)
File "/home/bidaya0/.local/lib/python3.9/site-packages/dongtai_sdk/DongTaiApi.py", line 65, in GetProjectList
return self.GetResponse("/projects","GET",data)
File "/home/bidaya0/.local/lib/python3.9/site-packages/dongtai_sdk/DongTaiApi.py", line 27, in GetResponse
return json.loads(rep.text)
File "/usr/lib/python3.9/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Should some fault tolerance logic and hints be added?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions