From 95cca433bc71b15c6651adb927f48a4e2d3f866a Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Wed, 16 Aug 2023 11:52:43 +1000 Subject: [PATCH] Catch all errors from requests, not just HTTPError --- lemonauth/views/tokens/list.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lemonauth/views/tokens/list.py b/lemonauth/views/tokens/list.py index 1912937..179621c 100644 --- a/lemonauth/views/tokens/list.py +++ b/lemonauth/views/tokens/list.py @@ -1,4 +1,4 @@ -from requests import HTTPError +from requests.exceptions import RequestException from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic import TemplateView from typing import Dict, Optional, Set @@ -24,7 +24,7 @@ class Client: try: apps = mf2(self.id).to_dict(filter_by_type="h-x-app") self.app = apps[0]["properties"] - except (HTTPError, IndexError): + except (RequestException, IndexError): self.app = None