From 50af1527fbe3f96fded0ec37579c3fd517c00d02 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Sat, 17 May 2025 21:39:40 +0200 Subject: [PATCH] Improve error handling in send method by logging response on failure --- micromail.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/micromail.py b/micromail.py index 4fd5a00..d3a1cae 100644 --- a/micromail.py +++ b/micromail.py @@ -189,9 +189,10 @@ class MicromailClient: self.write(content + b"\r\n") def send(self): - code, _ = self.send_command(b"\r\n.") + code, res = self.send_command(b"\r\n.") if code != b"250": print(f"Error: got code {code} on send") + print(res) sys.exit(1) print("Message sent successfully")