Improve error handling in send method by logging response on failure
This commit is contained in:
parent
6f336c17c0
commit
50af1527fb
1 changed files with 2 additions and 1 deletions
|
@ -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")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue