diff --git a/cognee/infrastructure/databases/graph/neptune_driver/exceptions.py b/cognee/infrastructure/databases/graph/neptune_driver/exceptions.py index 57d54d74d..d78936202 100644 --- a/cognee/infrastructure/databases/graph/neptune_driver/exceptions.py +++ b/cognee/infrastructure/databases/graph/neptune_driver/exceptions.py @@ -3,11 +3,11 @@ This module defines custom exceptions for Neptune Analytics operations. """ -from cognee.exceptions import CogneeApiError +from cognee.exceptions import CogneeSystemError from fastapi import status -class NeptuneAnalyticsError(CogneeApiError): +class NeptuneAnalyticsError(CogneeSystemError): """Base exception for Neptune Analytics operations.""" def __init__( diff --git a/cognee/modules/ingestion/exceptions/exceptions.py b/cognee/modules/ingestion/exceptions/exceptions.py index 08991a946..d43b69d60 100644 --- a/cognee/modules/ingestion/exceptions/exceptions.py +++ b/cognee/modules/ingestion/exceptions/exceptions.py @@ -1,8 +1,8 @@ -from cognee.exceptions import CogneeApiError +from cognee.exceptions import CogneeValidationError from fastapi import status -class IngestionError(CogneeApiError): +class IngestionError(CogneeValidationError): def __init__( self, message: str = "Type of data sent to classify not supported.", diff --git a/cognee/modules/ontology/exceptions/exceptions.py b/cognee/modules/ontology/exceptions/exceptions.py index 511e41524..daa8dcdb5 100644 --- a/cognee/modules/ontology/exceptions/exceptions.py +++ b/cognee/modules/ontology/exceptions/exceptions.py @@ -1,8 +1,8 @@ -from cognee.exceptions import CogneeApiError +from cognee.exceptions import CogneeSystemError from fastapi import status -class OntologyInitializationError(CogneeApiError): +class OntologyInitializationError(CogneeSystemError): def __init__( self, message: str = "Ontology initialization failed", @@ -12,7 +12,7 @@ class OntologyInitializationError(CogneeApiError): super().__init__(message, name, status_code) -class FindClosestMatchError(CogneeApiError): +class FindClosestMatchError(CogneeSystemError): def __init__( self, message: str = "Error in find_closest_match", @@ -22,7 +22,7 @@ class FindClosestMatchError(CogneeApiError): super().__init__(message, name, status_code) -class GetSubgraphError(CogneeApiError): +class GetSubgraphError(CogneeSystemError): def __init__( self, message: str = "Failed to retrieve subgraph", diff --git a/cognee/modules/pipelines/exceptions/exceptions.py b/cognee/modules/pipelines/exceptions/exceptions.py index 0a4863075..646a51286 100644 --- a/cognee/modules/pipelines/exceptions/exceptions.py +++ b/cognee/modules/pipelines/exceptions/exceptions.py @@ -1,8 +1,8 @@ -from cognee.exceptions import CogneeApiError +from cognee.exceptions import CogneeSystemError from fastapi import status -class PipelineRunFailedError(CogneeApiError): +class PipelineRunFailedError(CogneeSystemError): def __init__( self, message: str = "Pipeline run failed.", diff --git a/cognee/modules/users/exceptions/exceptions.py b/cognee/modules/users/exceptions/exceptions.py index a7484c05e..85ca8ab63 100644 --- a/cognee/modules/users/exceptions/exceptions.py +++ b/cognee/modules/users/exceptions/exceptions.py @@ -1,8 +1,8 @@ -from cognee.exceptions import CogneeApiError +from cognee.exceptions import CogneeValidationError from fastapi import status -class RoleNotFoundError(CogneeApiError): +class RoleNotFoundError(CogneeValidationError): """User group not found""" def __init__( @@ -14,7 +14,7 @@ class RoleNotFoundError(CogneeApiError): super().__init__(message, name, status_code) -class TenantNotFoundError(CogneeApiError): +class TenantNotFoundError(CogneeValidationError): """User group not found""" def __init__( @@ -26,7 +26,7 @@ class TenantNotFoundError(CogneeApiError): super().__init__(message, name, status_code) -class UserNotFoundError(CogneeApiError): +class UserNotFoundError(CogneeValidationError): """User not found""" def __init__( @@ -38,7 +38,7 @@ class UserNotFoundError(CogneeApiError): super().__init__(message, name, status_code) -class PermissionDeniedError(CogneeApiError): +class PermissionDeniedError(CogneeValidationError): def __init__( self, message: str = "User does not have permission on documents.", @@ -48,7 +48,7 @@ class PermissionDeniedError(CogneeApiError): super().__init__(message, name, status_code) -class PermissionNotFoundError(CogneeApiError): +class PermissionNotFoundError(CogneeValidationError): def __init__( self, message: str = "Permission type does not exist.", diff --git a/cognee/shared/exceptions/exceptions.py b/cognee/shared/exceptions/exceptions.py index 4b4164995..43084e04b 100644 --- a/cognee/shared/exceptions/exceptions.py +++ b/cognee/shared/exceptions/exceptions.py @@ -1,8 +1,8 @@ -from cognee.exceptions import CogneeApiError +from cognee.exceptions import CogneeValidationError from fastapi import status -class IngestionError(CogneeApiError): +class IngestionError(CogneeValidationError): def __init__( self, message: str = "Failed to load data.", diff --git a/cognee/tasks/completion/exceptions/exceptions.py b/cognee/tasks/completion/exceptions/exceptions.py index ac105a966..5052e2a77 100644 --- a/cognee/tasks/completion/exceptions/exceptions.py +++ b/cognee/tasks/completion/exceptions/exceptions.py @@ -1,8 +1,8 @@ -from cognee.exceptions import CogneeApiError +from cognee.exceptions import CogneeValidationError from fastapi import status -class NoRelevantDataError(CogneeApiError): +class NoRelevantDataError(CogneeValidationError): """ Represents an error when no relevant data is found during a search. This class is a subclass of CogneeApiError.