fix(teams): log reply() fallback for diagnostics
The previous bare except swallowed every exception from app.reply() silently. Log at debug so real failures (auth, chat gone) leave a trace while keeping the group-chat 400 fallback working. Also fix the Teams entry's indentation in the messaging flowchart.
This commit is contained in:
@@ -512,7 +512,14 @@ class TeamsAdapter(BasePlatformAdapter):
|
|||||||
if reply_to and reply_to.isdigit() and reply_to != "0":
|
if reply_to and reply_to.isdigit() and reply_to != "0":
|
||||||
try:
|
try:
|
||||||
result = await self._app.reply(chat_id, reply_to, chunk)
|
result = await self._app.reply(chat_id, reply_to, chunk)
|
||||||
except Exception:
|
except Exception as reply_err:
|
||||||
|
# Group chats 400 on threaded sends; the Teams SDK
|
||||||
|
# doesn't expose typed HTTP errors, so fall back on
|
||||||
|
# any exception and log for diagnostics.
|
||||||
|
logger.debug(
|
||||||
|
"Teams reply() failed, falling back to flat send: %s",
|
||||||
|
reply_err,
|
||||||
|
)
|
||||||
result = await self._app.send(chat_id, chunk)
|
result = await self._app.send(chat_id, chunk)
|
||||||
else:
|
else:
|
||||||
result = await self._app.send(chat_id, chunk)
|
result = await self._app.send(chat_id, chunk)
|
||||||
|
|||||||
@@ -60,9 +60,9 @@ flowchart TB
|
|||||||
bb[BlueBubbles]
|
bb[BlueBubbles]
|
||||||
qq[QQ]
|
qq[QQ]
|
||||||
yb[Yuanbao]
|
yb[Yuanbao]
|
||||||
ms[Microsoft Teams]
|
ms[Microsoft Teams]
|
||||||
api["API Server<br/>(OpenAI-compatible)"]
|
api["API Server<br/>(OpenAI-compatible)"]
|
||||||
wh[Webhooks]
|
wh[Webhooks]
|
||||||
end
|
end
|
||||||
|
|
||||||
store["Session store<br/>per chat"]
|
store["Session store<br/>per chat"]
|
||||||
|
|||||||
Reference in New Issue
Block a user