chore: Changing base classes for exceptions that were already defined
This commit is contained in:
parent
59c9204a74
commit
68327d3ab9
7 changed files with 20 additions and 20 deletions
|
|
@ -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__(
|
||||
|
|
|
|||
|
|
@ -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.",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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.",
|
||||
|
|
|
|||
|
|
@ -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.",
|
||||
|
|
|
|||
|
|
@ -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.",
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue