Open larsemil opened 6 years ago
I like the idea. What do you expect to happen inside sendSyntaxErrorInParameters()
? Which SMTP command should send the server to the client?
With an exceptionhandler like that where the client that got the exception is existing you can do whatever you want with the client.
if the clients methods are public that is. :)
I just want to figure out how this actually can happen. How can I reproduce an \Zend\Mail\Header\Exception\InvalidArgumentException
?
@larsemil Please re-test it with the newest version in master
.
This is not exactly what you wanted, but InvalidArgumentException
s will now be catched and sendSyntaxErrorInParameters()
will be called.
I would love to see a way to handle exceptions in a better way. I tried to implement it myself utilizing my own loop like this:
But problem is that there is for now NO way to tell the client connecting that something went wrong. It would be totally awesome if we could register an method to handle all exceptions from the server, which also would send the client for which the exception occurred. It could look something like this.
All in all - awesome package. :) :+1: