Update README.md to enhance MicromailClient documentation and add exceptions section; modify error handling in write method to raise NoSocketError

This commit is contained in:
Edgar P. Burkhart 2025-05-19 13:55:34 +02:00
parent 3795f8d8c0
commit 02e6f3fbcc
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
2 changed files with 59 additions and 27 deletions

View file

@ -110,7 +110,7 @@ class MicromailClient:
def write(self, data: str | bytes) -> None:
if self.socket is None:
raise Error("No socket to write to.")
raise NoSocketError
if isinstance(data, str):
data = data.encode()