summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruvok2025-01-19 17:47:28 +0100
committeruvok2025-01-19 17:47:28 +0100
commit0a2abd67f402980f5c2e6df1baceaa06eb886aad (patch)
tree787cdfa5b6bede9e9d05861e12ccb888ff9d67af
parent9ddf6b9ddf7b1b12845f62179a5104b600071c32 (diff)
Catch 404 / user not found
-rw-r--r--hello-fusepy.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/hello-fusepy.py b/hello-fusepy.py
index eed2371..366700b 100644
--- a/hello-fusepy.py
+++ b/hello-fusepy.py
@@ -67,6 +67,10 @@ class HelloWorld(Operations, LoggingMixIn):
def load_statuses(self):
url = api_url_template_ap.format(server=self.server, user=self.user)
res = requests.get(url)
+ if res.status_code == 404:
+ self.statuses = [Status("not-found", "User not found\n", "1970-01-01T00:00:00Z")]
+ return
+
res.raise_for_status()
stats = res.json()
logging.debug(f"Status: ${stats['id']}")