Exceptions

CogniteAPIError

exception cognite.client.exceptions.CogniteAPIError(
message: str,
code: int,
x_request_id: str | None = None,
missing: list | None = None,
duplicated: list | None = None,
successful: list | None = None,
failed: list | None = None,
unknown: list | None = None,
skipped: list | None = None,
cluster: str | None = None,
project: str | None = None,
extra: dict | None = None,
)

Cognite API Error

Raised if a given request fails. If one or more of concurrent requests fails, this exception will also contain information about which items were successfully processed (2xx), which may have been processed (5xx), and which have failed to be processed (4xx).

Parameters:
  • message (str) – The error message produced by the API.

  • code (int) – The error code produced by the failure.

  • x_request_id (str | None) – The request-id generated for the failed request.

  • missing (list | None) – List of missing identifiers.

  • duplicated (list | None) – List of duplicated identifiers.

  • successful (list | None) – List of items which were successfully processed.

  • failed (list | None) – List of items which failed.

  • unknown (list | None) – List of items which may or may not have been successfully processed.

  • skipped (list | None) – List of items that were skipped due to “fail fast” mode.

  • cluster (str | None) – Which Cognite cluster the user’s project is on.

  • project (str | None) – No description.

  • extra (dict | None) – A dict of any additional information.

CogniteNotFoundError

exception cognite.client.exceptions.CogniteNotFoundError(
message: str,
code: int,
missing: list,
**kwargs: Any,
)

Cognite Not Found Error

Raised if one or more of the referenced identifiers are not found.

CogniteDuplicatedError

exception cognite.client.exceptions.CogniteDuplicatedError(
message: str,
code: int,
duplicated: list,
**kwargs: Any,
)

Cognite Duplicated Error

Raised if one or more of the referenced identifiers have been duplicated in the request.

CogniteImportError

exception cognite.client.exceptions.CogniteImportError(module: str, message: str | None = None)

Cognite Import Error

Raised if the user attempts to use functionality which requires an uninstalled package.

Parameters:
  • module (str) – Name of the module which could not be imported

  • message (str | None) – The error message to output.

CogniteMissingClientError

exception cognite.client.exceptions.CogniteMissingClientError(obj: Any)

Cognite Missing Client Error

Raised if the user attempts to make use of a method which requires the cognite_client being set, but it is not.

Parameters:

obj (Any) – Object missing client reference.