Fix 401 for add block, too

This commit is contained in:
Shawn Grigson 2023-09-12 02:39:16 -05:00
parent d1fe11abf5
commit a1f81d197f
1 changed files with 3 additions and 0 deletions

View File

@ -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}")