Exceptions¶
All exceptions raised by the Pinecone SDK derive from PineconeError
so that a single except PineconeError block can catch every SDK error if desired.
Class Hierarchy¶
PineconeError
├── PineconeValueError (also ValueError)
├── PineconeTypeError (also TypeError)
├── PineconeConnectionError
├── PineconeTimeoutError (also TimeoutError)
├── ResponseParsingError
├── IndexInitFailedError
├── IndexTerminatedError
└── ApiError
├── ConflictError (409)
├── NotFoundError (404)
├── ForbiddenError (403)
├── UnauthorizedError (401)
├── PaymentRequiredError (402)
├── FailedPreconditionError (412)
├── RateLimitError (429)
└── ServiceError (5xx)
Base & Configuration Errors¶
- exception pinecone.errors.exceptions.PineconeError(message)[source]¶
Bases:
ExceptionBase exception for all Pinecone SDK errors.
- Parameters:
message (str)
- Return type:
None
- exception pinecone.errors.exceptions.PineconeValueError(message, path=None)[source]¶
Bases:
PineconeError,ValueErrorInput validation failed — invalid value.
- exception pinecone.errors.exceptions.PineconeTypeError(message, path=None)[source]¶
Bases:
PineconeError,TypeErrorInput validation failed — wrong type.
- exception pinecone.errors.exceptions.ResponseParsingError(message, cause=None)[source]¶
Bases:
PineconeErrorRaised when the SDK fails to parse an API response body.
Wraps the underlying deserialization error (e.g.
msgspec.ValidationError) so that callers’except PineconeErrorblocks always catch it.
- exception pinecone.errors.exceptions.IndexInitFailedError(index_name)[source]¶
Bases:
PineconeErrorRaised when an index fails to initialize.
- Parameters:
index_name (str)
- Return type:
None
- exception pinecone.errors.exceptions.IndexTerminatedError(name, state)[source]¶
Bases:
PineconeErrorRaised when polling an index that has entered a terminal non-init state.
Terminal states include
TerminatingandDisabled.
Network Errors¶
- exception pinecone.errors.exceptions.PineconeConnectionError(message)[source]¶
Bases:
PineconeErrorRaised when a network-level connection fails.
Covers DNS resolution failures, connection refused, read/write errors, and other transport-level problems.
- Parameters:
message (str)
- Return type:
None
- exception pinecone.errors.exceptions.PineconeTimeoutError(message, *, response=None)[source]¶
Bases:
PineconeError,TimeoutErrorRaised when an operation exceeds its timeout.
Multiply inherits from Python’s built-in
TimeoutErrorso thatexcept TimeoutErrorblocks in caller code catch SDK timeouts without having to import a Pinecone-specific class. This is the same pattern used byPineconeValueError(extendsValueError).- Parameters:
message (str) – Description of what timed out.
response (Any | None) – Partial result, when the timeout interrupted a bulk operation that had already applied some of its work. Carrying it means the caller can tell what landed instead of having to re-send everything;
response.failed_itemsis what remains.Nonefor timeouts with nothing partial to report.
- Return type:
None
API Errors¶
- exception pinecone.errors.exceptions.ApiError(message, status_code, body=None, *, reason=None, headers=None, error_code=None, request_id=None)[source]¶
Bases:
PineconeErrorServer returned an error response.
- Parameters:
- Return type:
None
- exception pinecone.errors.exceptions.NotFoundError(message='Resource not found', status_code=404, body=None, *, reason=None, headers=None, error_code=None, request_id=None)[source]¶
Bases:
ApiError404 Not Found.
- Parameters:
- Return type:
None
- exception pinecone.errors.exceptions.ConflictError(message='Resource conflict', status_code=409, body=None, *, reason=None, headers=None, error_code=None, request_id=None)[source]¶
Bases:
ApiError409 Conflict.
- Parameters:
- Return type:
None
- exception pinecone.errors.exceptions.UnauthorizedError(message='Invalid or missing API key', status_code=401, body=None, *, reason=None, headers=None, error_code=None, request_id=None)[source]¶
Bases:
ApiError401 Unauthorized.
- Parameters:
- Return type:
None
- exception pinecone.errors.exceptions.ForbiddenError(message='Forbidden', status_code=403, body=None, *, reason=None, headers=None, error_code=None, request_id=None)[source]¶
Bases:
ApiError403 Forbidden.
- Parameters:
- Return type:
None
- exception pinecone.errors.exceptions.PaymentRequiredError(message='Payment required', status_code=402, body=None, *, reason=None, headers=None, error_code=None, request_id=None)[source]¶
Bases:
ApiError402 Payment Required.
The organization’s billing state blocks the operation. Raised where the control plane gates resource creation on payment — notably
admin.projects.createandadmin.api_keys.create, which require the organization to have an active payment method or a plan that permits the request.Retrying will not help: the caller (or an organization owner) has to resolve the billing state first.
messagecarries the server’s explanation verbatim, so it is the authoritative description of what needs fixing.- Parameters:
- Return type:
None
- exception pinecone.errors.exceptions.FailedPreconditionError(message='Precondition failed', status_code=412, body=None, *, reason=None, headers=None, error_code=None, request_id=None)[source]¶
Bases:
ApiError412 Precondition Failed.
The request was well-formed but the target resource is not in a state that permits it. This is the dominant admin failure class: deleting a project or organization that still owns resources, or deleting a backup with a restore job still in flight, all answer 412.
The precondition is usually satisfiable — delete the blocking resources, or wait for the in-flight operation to finish, then retry.
messagecarries the server’s explanation verbatim and typically names the specific resources or job ids that are in the way.- Parameters:
- Return type:
None
- exception pinecone.errors.exceptions.RateLimitError(message='Rate limit exceeded', status_code=429, body=None, *, reason=None, headers=None, error_code=None, request_id=None, retry_after=None)[source]¶
Bases:
ApiError429 Too Many Requests.
retry_afteris parsed from theRetry-Afterresponse header when present and expressible as a non-negative number of seconds. HTTP-date values are not parsed and result inretry_after = None.- Parameters:
- Return type:
None
- exception pinecone.errors.exceptions.ServiceError(message='Internal server error', status_code=500, body=None, *, reason=None, headers=None, error_code=None, request_id=None)[source]¶
Bases:
ApiError5xx server error.
- Parameters:
- Return type:
None
Deprecated Aliases¶
The following names are kept for backwards compatibility and will be removed in a future major release. New code should use the canonical names listed above.
Alias |
Canonical class |
Notes |
|---|---|---|
|
Legacy base-class name |
|
|
Legacy API error name |
|
|
Legacy configuration error |
|
|
Legacy protocol error |
|
|
Legacy type error |
|
|
Legacy value error |
|
|
Legacy attribute error |
|
|
Legacy key error |
|
|
Legacy 404 error |
|
|
Legacy 401 error |
|
|
Legacy 403 error |
|
|
Legacy 5xx error |
|
|
Legacy 429 error |
|
|
Legacy list conversion error |
|
|
Legacy validation alias |