From 3e2dbd184661d3a5e06a249e553e071cbeadab5d Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Wed, 22 Oct 2025 17:38:41 +0100 Subject: [PATCH] Update deprecated Exception status codes --- cognee/exceptions/exceptions.py | 2 +- cognee/infrastructure/databases/exceptions/exceptions.py | 4 ++-- .../infrastructure/databases/vector/exceptions/exceptions.py | 2 +- cognee/infrastructure/files/exceptions.py | 2 +- cognee/modules/data/exceptions/exceptions.py | 2 +- cognee/modules/pipelines/exceptions/exceptions.py | 2 +- cognee/shared/exceptions/exceptions.py | 2 +- cognee/tasks/documents/exceptions/exceptions.py | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cognee/exceptions/exceptions.py b/cognee/exceptions/exceptions.py index d956d9cef..56a643fc6 100644 --- a/cognee/exceptions/exceptions.py +++ b/cognee/exceptions/exceptions.py @@ -56,7 +56,7 @@ class CogneeValidationError(CogneeApiError): self, message: str = "A validation error occurred.", name: str = "CogneeValidationError", - status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, + status_code=status.HTTP_422_UNPROCESSABLE_CONTENT, log=True, log_level="ERROR", ): diff --git a/cognee/infrastructure/databases/exceptions/exceptions.py b/cognee/infrastructure/databases/exceptions/exceptions.py index 8d7300b16..72b13e3a2 100644 --- a/cognee/infrastructure/databases/exceptions/exceptions.py +++ b/cognee/infrastructure/databases/exceptions/exceptions.py @@ -15,7 +15,7 @@ class DatabaseNotCreatedError(CogneeSystemError): self, message: str = "The database has not been created yet. Please call `await setup()` first.", name: str = "DatabaseNotCreatedError", - status_code: int = status.HTTP_422_UNPROCESSABLE_ENTITY, + status_code: int = status.HTTP_422_UNPROCESSABLE_CONTENT, ): super().__init__(message, name, status_code) @@ -99,7 +99,7 @@ class EmbeddingException(CogneeConfigurationError): self, message: str = "Embedding Exception.", name: str = "EmbeddingException", - status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, + status_code=status.HTTP_422_UNPROCESSABLE_CONTENT, ): super().__init__(message, name, status_code) diff --git a/cognee/infrastructure/databases/vector/exceptions/exceptions.py b/cognee/infrastructure/databases/vector/exceptions/exceptions.py index ecd106c0d..0ca75da14 100644 --- a/cognee/infrastructure/databases/vector/exceptions/exceptions.py +++ b/cognee/infrastructure/databases/vector/exceptions/exceptions.py @@ -15,7 +15,7 @@ class CollectionNotFoundError(CogneeValidationError): self, message, name: str = "CollectionNotFoundError", - status_code: int = status.HTTP_422_UNPROCESSABLE_ENTITY, + status_code: int = status.HTTP_422_UNPROCESSABLE_CONTENT, log=True, log_level="DEBUG", ): diff --git a/cognee/infrastructure/files/exceptions.py b/cognee/infrastructure/files/exceptions.py index 351eaee9c..f09ee5b6d 100644 --- a/cognee/infrastructure/files/exceptions.py +++ b/cognee/infrastructure/files/exceptions.py @@ -8,6 +8,6 @@ class FileContentHashingError(Exception): self, message: str = "Failed to hash content of the file.", name: str = "FileContentHashingError", - status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, + status_code=status.HTTP_422_UNPROCESSABLE_CONTENT, ): super().__init__(message, name, status_code) diff --git a/cognee/modules/data/exceptions/exceptions.py b/cognee/modules/data/exceptions/exceptions.py index ac3b68e64..c96d4e1c4 100644 --- a/cognee/modules/data/exceptions/exceptions.py +++ b/cognee/modules/data/exceptions/exceptions.py @@ -10,7 +10,7 @@ class UnstructuredLibraryImportError(CogneeConfigurationError): self, message: str = "Import error. Unstructured library is not installed.", name: str = "UnstructuredModuleImportError", - status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, + status_code=status.HTTP_422_UNPROCESSABLE_CONTENT, ): super().__init__(message, name, status_code) diff --git a/cognee/modules/pipelines/exceptions/exceptions.py b/cognee/modules/pipelines/exceptions/exceptions.py index 646a51286..79576f22a 100644 --- a/cognee/modules/pipelines/exceptions/exceptions.py +++ b/cognee/modules/pipelines/exceptions/exceptions.py @@ -7,6 +7,6 @@ class PipelineRunFailedError(CogneeSystemError): self, message: str = "Pipeline run failed.", name: str = "PipelineRunFailedError", - status_code: int = status.HTTP_422_UNPROCESSABLE_ENTITY, + status_code: int = status.HTTP_422_UNPROCESSABLE_CONTENT, ): super().__init__(message, name, status_code) diff --git a/cognee/shared/exceptions/exceptions.py b/cognee/shared/exceptions/exceptions.py index 43084e04b..3740f677d 100644 --- a/cognee/shared/exceptions/exceptions.py +++ b/cognee/shared/exceptions/exceptions.py @@ -7,6 +7,6 @@ class IngestionError(CogneeValidationError): self, message: str = "Failed to load data.", name: str = "IngestionError", - status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, + status_code=status.HTTP_422_UNPROCESSABLE_CONTENT, ): super().__init__(message, name, status_code) diff --git a/cognee/tasks/documents/exceptions/exceptions.py b/cognee/tasks/documents/exceptions/exceptions.py index 737e9a3d1..61274ea45 100644 --- a/cognee/tasks/documents/exceptions/exceptions.py +++ b/cognee/tasks/documents/exceptions/exceptions.py @@ -12,7 +12,7 @@ class WrongDataDocumentInputError(CogneeValidationError): self, field: str, name: str = "WrongDataDocumentInputError", - status_code: int = status.HTTP_422_UNPROCESSABLE_ENTITY, + status_code: int = status.HTTP_422_UNPROCESSABLE_CONTENT, ): message = f"Missing of invalid parameter: '{field}'." super().__init__(message, name, status_code)