From 1c3ee168537f2c66cbf8d50b66f2e827d42cc5c0 Mon Sep 17 00:00:00 2001 From: "s.mostryukov" Date: Thu, 19 Jun 2025 14:49:29 +0300 Subject: [PATCH] fix exception --- app/backup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/backup.py b/app/backup.py index c341940..2a5e546 100644 --- a/app/backup.py +++ b/app/backup.py @@ -77,7 +77,7 @@ def send_command(connection: ConnectHandler, command: str) -> str: except exceptions.NetmikoTimeoutException: result = "NetmikoTimeoutException" except exceptions.ReadTimeout: - result = "NetmikoTimeoutException" + result = "ReadTimeout" return result @@ -93,6 +93,9 @@ def save_mikrotik_bcp(host: str, name: str) -> None: result = send_command(connection, "export terse show-sensitive") connection.disconnect() if result == "NetmikoTimeoutException": + log.warning("Timeout error %r", name) + return + elif result == "ReadTimeout": log.warning("Timeout read config from %r", name) return log.info("disconnected from %r", name)