I’ve subclassed SSLSocket, and I’m using AddHandler to add an error handler. Under API 1.0 my delegate method had the one parameter, the subclass. That has worked fine so far.
Under API 2.0, the error handler is defined as having a RuntimeException as a parameter, but I don’t seem to be able to declare that without the compiler complaining. A declaration like this, for instance:
Sub errorEvent (s as MySSLClass, e as RuntimeException)
used with AddHandler thus:
Addhandler me.Error, WeakAddressOf errorEvent
and the compiler complains that “this method requires more parameters than were passed” and about a delegate mismatch. I suppose my syntax is wrong somehow - can anyone advise?
Also: if I have an error handler handling errors, albeit passed as an exception, do I still need try/catch round socket actions?
This is a documentation error. You should report it via Feedback. SSLSocket’s Error event signature is unchanged, and does not have an exception parameter in 2019R2.
You can quickly check things like this for yourself in the future by adding an instance of the class to a window then adding an event handler for the event you wish to look at.