hydroshare / hs_restclient

Python client for the https://www.hydroshare.org REST API
BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

hs.createReferencedFile() throws out an error occasionally #91

Open zhiyuli opened 5 years ago

zhiyuli commented 5 years ago

The same code works fine most of the time, but it throws out this error occasionally: Not sure it is a hs_restclient issue or REST endpoint issue on hydroshare side:

hs.createReferencedFile(pid=resource_id, path='data/contents', name='landing_page.url', ref_url="https://www.byu.edu/")

Traceback (most recent call last): File "C:/Users/Drew/PycharmProjects/czo/bulk-resource-creator/hs_json.py", line 128, in hs.createReferencedFile(pid=resource_id, path='data/contents', name='landing_page.url', ref_url="https://www.byu.edu/") File "C:\Users\Drew\Miniconda3\envs\py27\lib\site-packages\hs_restclient__init.py", line 1111, in createReferencedFile raise HydroShareHTTPException((url, 'POST', r.status_code)) File "C:\Users\Drew\Miniconda3\envs\py27\lib\site-packages\hs_restclient\exceptions.py", line 66, in init__ self.status_msg = args[3] IndexError: tuple index out of range