Runs an optional onDisconnect callback with error isolation.
onDisconnect
If the callback throws, the error is logged and forwarded to the provided error handler rather than propagating to the caller.
The disconnect callback to invoke, or undefined to skip.
undefined
Logger function for diagnostic output.
Error handler to receive any thrown errors.
Runs an optional
onDisconnectcallback with error isolation.If the callback throws, the error is logged and forwarded to the provided error handler rather than propagating to the caller.