forked from 00dani/lemoncurry
Catch all errors from requests, not just HTTPError
This commit is contained in:
parent
4f081c8d34
commit
95cca433bc
1 changed files with 2 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
from requests import HTTPError
|
from requests.exceptions import RequestException
|
||||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||||
from django.views.generic import TemplateView
|
from django.views.generic import TemplateView
|
||||||
from typing import Dict, Optional, Set
|
from typing import Dict, Optional, Set
|
||||||
|
@ -24,7 +24,7 @@ class Client:
|
||||||
try:
|
try:
|
||||||
apps = mf2(self.id).to_dict(filter_by_type="h-x-app")
|
apps = mf2(self.id).to_dict(filter_by_type="h-x-app")
|
||||||
self.app = apps[0]["properties"]
|
self.app = apps[0]["properties"]
|
||||||
except (HTTPError, IndexError):
|
except (RequestException, IndexError):
|
||||||
self.app = None
|
self.app = None
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue