mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-22 15:21:01 +00:00
Catch more request errors
This commit is contained in:
parent
8d56f8388f
commit
0fdeb48ff4
1 changed files with 2 additions and 2 deletions
|
@ -305,7 +305,7 @@ class Identity(StatorModel):
|
||||||
method="get",
|
method="get",
|
||||||
uri=f"https://{domain}/.well-known/webfinger?resource=acct:{handle}",
|
uri=f"https://{domain}/.well-known/webfinger?resource=acct:{handle}",
|
||||||
)
|
)
|
||||||
except httpx.RequestError:
|
except (httpx.RequestError, httpx.ConnectError):
|
||||||
return None, None
|
return None, None
|
||||||
if response.status_code in [404, 410]:
|
if response.status_code in [404, 410]:
|
||||||
return None, None
|
return None, None
|
||||||
|
@ -339,7 +339,7 @@ class Identity(StatorModel):
|
||||||
method="get",
|
method="get",
|
||||||
uri=self.actor_uri,
|
uri=self.actor_uri,
|
||||||
)
|
)
|
||||||
except httpx.RequestError:
|
except (httpx.ConnectError, httpx.RequestError):
|
||||||
return False
|
return False
|
||||||
if response.status_code == 410:
|
if response.status_code == 410:
|
||||||
# Their account got deleted, so let's do the same.
|
# Their account got deleted, so let's do the same.
|
||||||
|
|
Loading…
Reference in a new issue