Table of Contents

Class NotConnectedException

Namespace
WhalesSecret.TradeScriptLib.Exceptions
Assembly
WhalesSecret.TradeScriptLib.dll

Exception for situations where an exchange API request could not be sent due to a lack of connection.

For example an API request to an exchange or a remote call message to another script, or when it is known that it will not be possible to further communicate with the counterparty. This can be due to loss of network connection, or intentional disconnection or shutdown.

public class NotConnectedException : ScriptApiException, ISerializable
Inheritance
NotConnectedException
Implements
Derived
Inherited Members
Extension Methods

Remarks

An example scenario illustrating use of NotConnectedException is:

  1. An exchange provides WebSocket API.
  2. WhalesSecret connects to a WebSocket endpoint.
  3. The connection is lost a few seconds afterwards.
  4. Trade script attempts to create a new limit order on the exchange.
  5. At this point WhalesSecret throws NotConnectedException because it is undoubtedly clear that no request was sent to the exchange and there is no risk associated with ignoring the request failure.

It is very important to note that user can very easily recover from this exception given that the exchange did not do any operation for us.

Constructors

NotConnectedException()

Initializes a new instance of the NotConnectedException class.

NotConnectedException(string)

Initializes a new instance of the NotConnectedException class with a specified error message.

NotConnectedException(string, Exception?)

Initializes a new instance of the NotConnectedException class with a specified error message and a reference to the inner exception that is the cause of this exception.