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
1 changed files with 5 additions and 0 deletions

View File

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