示例#1
0
        public WebSocketManagerException(IKucoinWebSocketClient client, string message, Exception innerException)
            : base(message, innerException)
        {
            Throw.IfNull(client, nameof(client));

            Client = client;
        }
        /// <summary>
        /// Raise an error event on controller exception.
        /// </summary>
        /// <param name="client">The client associated with the exception.</param>
        /// <param name="exception">The inner exception.</param>
        /// <param name="message">The exception message (optional).</param>
        private void RaiseErrorEvent(IKucoinWebSocketClient client, Exception exception, string message = null)
        {
            var args = new WebSocketManagerErrorEventArgs(
                new WebSocketManagerException(client, message, exception));

            try { Error?.Invoke(this, args); }
            catch (OperationCanceledException) { }
            catch (Exception e)
            {
                _logger?.LogError(e, $"{nameof(KucoinWebSocketManager)}: Unhandled error event handler exception.");
            }
        }
示例#3
0
 public WebSocketManagerException(IKucoinWebSocketClient client, Exception innerException)
     : this(client, null, innerException)
 {
 }
示例#4
0
 public WebSocketManagerException(IKucoinWebSocketClient client, string message)
     : this(client, message, null)
 {
 }
示例#5
0
 public WebSocketManagerException(IKucoinWebSocketClient client)
     : this(client, null, null)
 {
 }
示例#6
0
        /// <summary>
        /// Get the <see cref="IRetryTaskController"/> associated with the
        /// <see cref="IKucoinWebSocketClient"/> web socket stream.
        /// </summary>
        /// <param name="manager"></param>
        /// <param name="client"></param>
        /// <returns></returns>
        public static IRetryTaskController GetController(this IKucoinWebSocketManager manager, IKucoinWebSocketClient client)
        {
            Throw.IfNull(manager, nameof(manager));
            Throw.IfNull(client, nameof(client));

            return(manager.GetController(client.WebSocket));
        }