MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / NotPrimaryError

Class NotPrimaryError

pymongo/errors.py:133–152  ·  view source on GitHub ↗

The server responded "not primary" or "node is recovering". These errors result from a query, write, or command. The operation failed because the client thought it was using the primary but the primary has stepped down, or the client thought it was using a healthy secondary but the

Source from the content-addressed store, hash-verified

131
132
133class NotPrimaryError(AutoReconnect):
134 """The server responded "not primary" or "node is recovering".
135
136 These errors result from a query, write, or command. The operation failed
137 because the client thought it was using the primary but the primary has
138 stepped down, or the client thought it was using a healthy secondary but
139 the secondary is stale and trying to recover.
140
141 The client launches a refresh operation on a background thread, to update
142 its view of the server as soon as possible after throwing this exception.
143
144 Subclass of :exc:`~pymongo.errors.AutoReconnect`.
145
146 .. versionadded:: 3.12
147 """
148
149 def __init__(
150 self, message: str = "", errors: Optional[Union[Mapping[str, Any], list[Any]]] = None
151 ) -> None:
152 super().__init__(_format_detailed_error(message, errors), errors=errors)
153
154
155class ServerSelectionTimeoutError(AutoReconnect):

Callers 7

_check_command_responseFunction · 0.90
raw_responseMethod · 0.90

Calls

no outgoing calls