From a1f81d197faf3e1356f9ee56ff47ac0dd6f7faa9 Mon Sep 17 00:00:00 2001 From: Shawn Grigson Date: Tue, 12 Sep 2023 02:39:16 -0500 Subject: [PATCH] Fix 401 for add block, too --- src/fediblockhole/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fediblockhole/__init__.py b/src/fediblockhole/__init__.py index 995fd7e..c9a7531 100755 --- a/src/fediblockhole/__init__.py +++ b/src/fediblockhole/__init__.py @@ -554,6 +554,9 @@ def add_block(token: str, host: str, blockdata: DomainBlock, scheme: str='https' err = json.loads(response.content) log.warning(err['error']) + elif response.status_code == 401: + log.warning(f"Access token has been revoked for {host}, no blocks being updated.") + elif response.status_code != 200: raise ValueError(f"Something went wrong: {response.status_code}: {response.content}")