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 in script. #559

Open
haesleinhuepf opened this issue Dec 17, 2024 · 0 comments · May be fixed by #560
Open

Error in script. #559

haesleinhuepf opened this issue Dec 17, 2024 · 0 comments · May be fixed by #560

Comments

@haesleinhuepf
Copy link
Member

We should catch this error with a try-except block so that the for-loop can continue:

return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/json/decoder.py", line 338, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/json/decoder.py", line 356, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/work/training/training/scripts/auto-add-from-zenodo-communities.py", line 105, in <module>
    main()
  File "/home/runner/work/training/training/scripts/auto-add-from-zenodo-communities.py", line 62, in main
    data = complete_zenodo_data(url)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/training/training/scripts/generate_link_lists.py", line 496, in complete_zenodo_data
    zenodo_data = read_zenodo(zenodo_url)
                  ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/training/training/scripts/generate_link_lists.py", line 324, in read_zenodo
    data = response.json()
           ^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/requests/models.py", line 978, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Error: Process completed with exit code 1.

git-bob implement this!

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 a pull request may close this issue.

1 participant