Merge PR #957: fix(slack): add exception handling to socket listener
This commit is contained in:
@@ -179,18 +179,21 @@ class SlackChannel(BaseChannel):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.debug("Slack reactions_add failed: {}", e)
|
logger.debug("Slack reactions_add failed: {}", e)
|
||||||
|
|
||||||
await self._handle_message(
|
try:
|
||||||
sender_id=sender_id,
|
await self._handle_message(
|
||||||
chat_id=chat_id,
|
sender_id=sender_id,
|
||||||
content=text,
|
chat_id=chat_id,
|
||||||
metadata={
|
content=text,
|
||||||
"slack": {
|
metadata={
|
||||||
"event": event,
|
"slack": {
|
||||||
"thread_ts": thread_ts,
|
"event": event,
|
||||||
"channel_type": channel_type,
|
"thread_ts": thread_ts,
|
||||||
}
|
"channel_type": channel_type,
|
||||||
},
|
}
|
||||||
)
|
},
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
logger.exception("Error handling Slack message from {}", sender_id)
|
||||||
|
|
||||||
def _is_allowed(self, sender_id: str, chat_id: str, channel_type: str) -> bool:
|
def _is_allowed(self, sender_id: str, chat_id: str, channel_type: str) -> bool:
|
||||||
if channel_type == "im":
|
if channel_type == "im":
|
||||||
|
|||||||
Reference in New Issue
Block a user