component AP gateway: log a warning instead of raising an exception in onMessage:
if something goes wrong, a warning is logged instead of raising a failing in `onMessage`'s `get_ap_actor_id_from_account` and `sign_and_post` calls.
This commit is contained in:
parent
0979b3fee3
commit
510b6fb62c
1 changed files with 15 additions and 2 deletions
|
|
@ -2277,7 +2277,14 @@ class APGateway:
|
|||
return mess_data
|
||||
|
||||
actor_account = self._e.unescape(mess_data["to"].user)
|
||||
actor_id = await self.get_ap_actor_id_from_account(actor_account)
|
||||
try:
|
||||
actor_id = await self.get_ap_actor_id_from_account(actor_account)
|
||||
except Exception as e:
|
||||
log.warning(
|
||||
f"Can't retrieve data on actor {actor_account}: {e}"
|
||||
)
|
||||
# TODO: send an error <message>
|
||||
return mess_data
|
||||
inbox = await self.get_ap_inbox_from_id(actor_id, use_shared=False)
|
||||
|
||||
try:
|
||||
|
|
@ -2313,7 +2320,13 @@ class APGateway:
|
|||
"name": f"@{actor_account}",
|
||||
})
|
||||
|
||||
await self.sign_and_post(inbox, ap_item["actor"], ap_item)
|
||||
try:
|
||||
await self.sign_and_post(inbox, ap_item["actor"], ap_item)
|
||||
except Exception as e:
|
||||
# TODO: send an error <message>
|
||||
log.warning(
|
||||
f"Can't send message to {inbox}: {e}"
|
||||
)
|
||||
return mess_data
|
||||
|
||||
async def _on_message_retract(
|
||||
|
|
|
|||
Loading…
Reference in a new issue