/// <summary> /// Invoke event for exceptions. /// </summary> /// <param name="e">The exception to propagate.</param> /// <param name="reconnectDelay">The current reconnection attempt delay.</param> protected virtual void OnErrorState(Exception e, int reconnectDelay) { errorMessage = new WsClientErrorMessage { Error = e, ReconnectDelay = reconnectDelay }; ErrorState?.Invoke(this, errorMessage); }