Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
fix: raise instead of swallowing on outbound-message path errors
Vilius Vystartas31c45fe7983e
diff --git a/nanobot/channels/matrix.py b/nanobot/channels/matrix.pyindex 899c72f0f..28e6197a8 100644--- a/nanobot/channels/matrix.py+++ b/nanobot/channels/matrix.py@@ -412,7 +412,7 @@ class MatrixChannel(BaseChannel):try:response = await self.client.content_repository_config()except Exception:- self.logger.warning("Failed to fetch server upload limit", exc_info=True)+ self.logger.error("Failed to fetch server upload limit", exc_info=True)return Noneupload_size = getattr(response, "upload_size", None)if isinstance(upload_size, int) and upload_size > 0:@@ -458,8 +458,7 @@ class MatrixChannel(BaseChannel):filesize=size_bytes,)except Exception:- self.logger.warning("Media upload failed", exc_info=True)- return fail+ raiseupload_response = upload_result[0] if isinstance(upload_result, tuple) else upload_resultencryption_info = upload_result[1] if isinstance(upload_result, tuple) and isinstance(upload_result[1], dict) else None@@ -478,8 +477,7 @@ class MatrixChannel(BaseChannel):try:await self._send_room_content(room_id, content)except Exception:- self.logger.warning("Failed to send room content to room_id=%s", room_id, exc_info=True)- return fail+ raisereturn Noneasync def send(self, msg: OutboundMessage) -> None:@@ -556,8 +554,9 @@ class MatrixChannel(BaseChannel):# we are editing the same message all the time, so only the first time the event id needs to be setbuf.event_id = response.event_idexcept Exception:- self.logger.warning("Stream send/edit failed for chat_id=%s", chat_id, exc_info=True)+ self.logger.error("Stream send/edit failed for chat_id=%s", chat_id, exc_info=True)await self._stop_typing_keepalive(chat_id, clear_typing=True)+ raisedef _register_event_callbacks(self) -> None:diff --git a/nanobot/channels/weixin.py b/nanobot/channels/weixin.pyindex 2fa0aa4c4..915305abc 100644--- a/nanobot/channels/weixin.py+++ b/nanobot/channels/weixin.py@@ -208,7 +208,7 @@ class WeixinChannel(BaseChannel):self.config.base_url = base_urlreturn bool(self._token)except Exception:- self.logger.warning("Failed to load Weixin account state", exc_info=True)+ self.logger.error("Failed to load Weixin account state", exc_info=True)return Falsedef _save_state(self) -> None: