Update deprecated Exception status codes
This commit is contained in:
parent
340fca3383
commit
3e2dbd1846
8 changed files with 9 additions and 9 deletions
|
|
@ -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",
|
||||
):
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
):
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue