It seems all api functions can, in addition to the documented exceptions, encounter an json.decoder.JSONDecodeError. The following backtrace was taken from a corosync log which uses my ocf and stonith agent:
Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/lib/ocf/resource.d/hetzner/FloatingIP/__main__.py", line 25, in <module>
File "/usr/lib/ocf/resource.d/hetzner/FloatingIP/ocf.py", line 121, in run
File "/usr/lib/ocf/resource.d/hetzner/FloatingIP/floating_ip.py", line 159, in monitor
File "/usr/lib/ocf/resource.d/hetzner/FloatingIP/shared.py", line 56, in find
File "/usr/local/lib/python3.5/dist-packages/hetznercloud/servers.py", line 65, in get_all
status_code, results = _get_results(self._config, "servers", {"name": name} if name is not None else None)
File "/usr/local/lib/python3.5/dist-packages/hetznercloud/shared.py", line 34, in _get_results
js = request.json()
File "/usr/local/lib/python3.5/dist-packages/requests/models.py", line 892, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I would expect this to either be caught and wrapped into a HetznerInternalServerErrorException or documented in the Standard exceptions section.
This seems to be a rather exceptional situation but from previous experience it seems like it could happen for a few requests every 5-14 days on a continues monitoring every 30 seconds
It seems all api functions can, in addition to the documented exceptions, encounter an json.decoder.JSONDecodeError. The following backtrace was taken from a corosync log which uses my ocf and stonith agent:
I would expect this to either be caught and wrapped into a HetznerInternalServerErrorException or documented in the Standard exceptions section.
This seems to be a rather exceptional situation but from previous experience it seems like it could happen for a few requests every 5-14 days on a continues monitoring every 30 seconds