Also catch HTTPException in API.check_companion_enabled

This commit is contained in:
Odd Stråbø 2024-05-18 01:54:06 +02:00
parent 704c8829f0
commit 1899ecb999

View file

@ -6,6 +6,7 @@ import json
import requests import requests
from six import ensure_str from six import ensure_str
from ..helper.exceptions import HTTPException
from ..helper.utils import settings from ..helper.utils import settings
from ..helper import LazyLogger from ..helper import LazyLogger
@ -268,6 +269,10 @@ class API(object):
LOG.warning("Error checking companion installed state: %s", e) LOG.warning("Error checking companion installed state: %s", e)
if e.response.status_code == 404: if e.response.status_code == 404:
return False return False
except HTTPException as e:
LOG.warning("Error checking companion installed state: %s", e)
if e.status == 404:
return False
return None return None