device_tracker.ubus: catch ConnectionError (#14045)
When an OpenWrt device monitored via ubus is offline, this causes the log to be flooded with several exceptions. Avoid this by catching requests.exceptions.ConnectionError in addition to requests.exceptions.Timeout. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
This commit is contained in:
parent
86374ad809
commit
1fbc650871
1 changed files with 1 additions and 1 deletions
|
@ -207,7 +207,7 @@ def _req_json_rpc(url, session_id, rpcmethod, subsystem, method, **params):
|
|||
try:
|
||||
res = requests.post(url, data=data, timeout=5)
|
||||
|
||||
except requests.exceptions.Timeout:
|
||||
except (requests.exceptions.ConnectionError, requests.exceptions.Timeout):
|
||||
return
|
||||
|
||||
if res.status_code == 200:
|
||||
|
|
Loading…
Add table
Reference in a new issue