Update deprecated Exception status codes

This commit is contained in:
Daulet Amirkhanov 2025-10-22 17:38:41 +01:00
parent 340fca3383
commit 3e2dbd1846
8 changed files with 9 additions and 9 deletions

View file

@ -56,7 +56,7 @@ class CogneeValidationError(CogneeApiError):
self, self,
message: str = "A validation error occurred.", message: str = "A validation error occurred.",
name: str = "CogneeValidationError", name: str = "CogneeValidationError",
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
log=True, log=True,
log_level="ERROR", log_level="ERROR",
): ):

View file

@ -15,7 +15,7 @@ class DatabaseNotCreatedError(CogneeSystemError):
self, self,
message: str = "The database has not been created yet. Please call `await setup()` first.", message: str = "The database has not been created yet. Please call `await setup()` first.",
name: str = "DatabaseNotCreatedError", 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) super().__init__(message, name, status_code)
@ -99,7 +99,7 @@ class EmbeddingException(CogneeConfigurationError):
self, self,
message: str = "Embedding Exception.", message: str = "Embedding Exception.",
name: str = "EmbeddingException", name: str = "EmbeddingException",
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
): ):
super().__init__(message, name, status_code) super().__init__(message, name, status_code)

View file

@ -15,7 +15,7 @@ class CollectionNotFoundError(CogneeValidationError):
self, self,
message, message,
name: str = "CollectionNotFoundError", name: str = "CollectionNotFoundError",
status_code: int = status.HTTP_422_UNPROCESSABLE_ENTITY, status_code: int = status.HTTP_422_UNPROCESSABLE_CONTENT,
log=True, log=True,
log_level="DEBUG", log_level="DEBUG",
): ):

View file

@ -8,6 +8,6 @@ class FileContentHashingError(Exception):
self, self,
message: str = "Failed to hash content of the file.", message: str = "Failed to hash content of the file.",
name: str = "FileContentHashingError", name: str = "FileContentHashingError",
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
): ):
super().__init__(message, name, status_code) super().__init__(message, name, status_code)

View file

@ -10,7 +10,7 @@ class UnstructuredLibraryImportError(CogneeConfigurationError):
self, self,
message: str = "Import error. Unstructured library is not installed.", message: str = "Import error. Unstructured library is not installed.",
name: str = "UnstructuredModuleImportError", name: str = "UnstructuredModuleImportError",
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
): ):
super().__init__(message, name, status_code) super().__init__(message, name, status_code)

View file

@ -7,6 +7,6 @@ class PipelineRunFailedError(CogneeSystemError):
self, self,
message: str = "Pipeline run failed.", message: str = "Pipeline run failed.",
name: str = "PipelineRunFailedError", 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) super().__init__(message, name, status_code)

View file

@ -7,6 +7,6 @@ class IngestionError(CogneeValidationError):
self, self,
message: str = "Failed to load data.", message: str = "Failed to load data.",
name: str = "IngestionError", name: str = "IngestionError",
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
): ):
super().__init__(message, name, status_code) super().__init__(message, name, status_code)

View file

@ -12,7 +12,7 @@ class WrongDataDocumentInputError(CogneeValidationError):
self, self,
field: str, field: str,
name: str = "WrongDataDocumentInputError", 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}'." message = f"Missing of invalid parameter: '{field}'."
super().__init__(message, name, status_code) super().__init__(message, name, status_code)