You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 9, 2023. It is now read-only.
## What is the goal of this PR?
We use a new protocol API to perform a "connection open". This API does server-side protocol version compatibility checks, and replaces our previous need to get all databases to check that the connection is available.
This API is called transparently during the construction of both the Core and Cluster clients.
## What are the changes implemented in this PR?
* Refactor Stubs to call `connectionOpen` in their constructors
* Throw a useful message if the server returns an `unimplemented` error
CLIENT_CLOSED=ClientErrorMessage(1, "The client has been closed and no further operation is allowed.")
79
-
SESSION_CLOSED=ClientErrorMessage(2, "The session has been closed and no further operation is allowed.")
80
-
TRANSACTION_CLOSED=ClientErrorMessage(3, "The transaction has been closed and no further operation is allowed.")
81
-
TRANSACTION_CLOSED_WITH_ERRORS=ClientErrorMessage(4, "The transaction has been closed with error(s):\n%s.")
82
-
UNABLE_TO_CONNECT=ClientErrorMessage(5, "Unable to connect to TypeDB server.")
83
-
NEGATIVE_VALUE_NOT_ALLOWED=ClientErrorMessage(6, "Value cannot be less than 1, was: '%d'.")
84
-
MISSING_DB_NAME=ClientErrorMessage(7, "Database name cannot be empty.")
85
-
DB_DOES_NOT_EXIST=ClientErrorMessage(8, "The database '%s' does not exist.")
86
-
MISSING_RESPONSE=ClientErrorMessage(9, "Unexpected empty response for request ID '%s'.")
87
-
UNKNOWN_REQUEST_ID=ClientErrorMessage(10, "Received a response with unknown request id '%s':\n%s")
88
-
CLUSTER_NO_PRIMARY_REPLICA_YET=ClientErrorMessage(11, "No replica has been marked as the primary replica for latest known term '%d'.")
89
-
CLUSTER_UNABLE_TO_CONNECT=ClientErrorMessage(12, "Unable to connect to TypeDB Cluster. Attempted connecting to the cluster members, but none are available: '%s'.")
90
-
CLUSTER_REPLICA_NOT_PRIMARY=ClientErrorMessage(13, "The replica is not the primary replica.")
91
-
CLUSTER_ALL_NODES_FAILED=ClientErrorMessage(14, "Attempted connecting to all cluster members, but the following errors occurred: \n%s")
92
-
CLUSTER_USER_DOES_NOT_EXIST=ClientErrorMessage(15, "The user '%s' does not exist.")
CLUSTER_INVALID_ROOT_CA_PATH=ClientErrorMessage(17, "The provided Root CA path '%s' does not exist.")
95
-
CLUSTER_CLIENT_CALLED_WITH_STRING=ClientErrorMessage(18, "The first argument of TypeDBClient.cluster() must be a List of server addresses to connect to. It was called with a string, not a List, which is not allowed.")
80
+
RPC_METHOD_UNAVAILABLE=ClientErrorMessage(1, "The server does not support this method, please check the client-server compatibility:\n'%s'.")
81
+
CLIENT_NOT_OPEN=ClientErrorMessage(2, "The client is not open.")
82
+
SESSION_CLOSED=ClientErrorMessage(3, "The session has been closed and no further operation is allowed.")
83
+
TRANSACTION_CLOSED=ClientErrorMessage(4, "The transaction has been closed and no further operation is allowed.")
84
+
TRANSACTION_CLOSED_WITH_ERRORS=ClientErrorMessage(5, "The transaction has been closed with error(s):\n%s.")
85
+
UNABLE_TO_CONNECT=ClientErrorMessage(6, "Unable to connect to TypeDB server.")
86
+
NEGATIVE_VALUE_NOT_ALLOWED=ClientErrorMessage(7, "Value cannot be less than 1, was: '%d'.")
87
+
MISSING_DB_NAME=ClientErrorMessage(8, "Database name cannot be empty.")
88
+
DB_DOES_NOT_EXIST=ClientErrorMessage(9, "The database '%s' does not exist.")
89
+
MISSING_RESPONSE=ClientErrorMessage(10, "Unexpected empty response for request ID '%s'.")
90
+
UNKNOWN_REQUEST_ID=ClientErrorMessage(11, "Received a response with unknown request id '%s':\n%s")
91
+
CLUSTER_NO_PRIMARY_REPLICA_YET=ClientErrorMessage(12, "No replica has been marked as the primary replica for latest known term '%d'.")
92
+
CLUSTER_UNABLE_TO_CONNECT=ClientErrorMessage(13, "Unable to connect to TypeDB Cluster. Attempted connecting to the cluster members, but none are available: '%s'.")
93
+
CLUSTER_REPLICA_NOT_PRIMARY=ClientErrorMessage(14, "The replica is not the primary replica.")
94
+
CLUSTER_ALL_NODES_FAILED=ClientErrorMessage(15, "Attempted connecting to all cluster members, but the following errors occurred: \n%s")
95
+
CLUSTER_USER_DOES_NOT_EXIST=ClientErrorMessage(16, "The user '%s' does not exist.")
CLUSTER_INVALID_ROOT_CA_PATH=ClientErrorMessage(18, "The provided Root CA path '%s' does not exist.")
98
+
CLUSTER_CLIENT_CALLED_WITH_STRING=ClientErrorMessage(19, "The first argument of TypeDBClient.cluster() must be a List of server addresses to connect to. It was called with a string, not a List, which is not allowed.")
0 commit comments