feat: setting base classes of data exceptions to the new ones
This commit is contained in:
parent
623148ec6a
commit
7bd2660d08
1 changed files with 8 additions and 5 deletions
|
|
@ -1,8 +1,11 @@
|
||||||
from cognee.exceptions import CogneeApiError
|
from cognee.exceptions import (
|
||||||
|
CogneeValidationError,
|
||||||
|
CogneeConfigurationError,
|
||||||
|
)
|
||||||
from fastapi import status
|
from fastapi import status
|
||||||
|
|
||||||
|
|
||||||
class UnstructuredLibraryImportError(CogneeApiError):
|
class UnstructuredLibraryImportError(CogneeConfigurationError):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
message: str = "Import error. Unstructured library is not installed.",
|
message: str = "Import error. Unstructured library is not installed.",
|
||||||
|
|
@ -12,7 +15,7 @@ class UnstructuredLibraryImportError(CogneeApiError):
|
||||||
super().__init__(message, name, status_code)
|
super().__init__(message, name, status_code)
|
||||||
|
|
||||||
|
|
||||||
class UnauthorizedDataAccessError(CogneeApiError):
|
class UnauthorizedDataAccessError(CogneeValidationError):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
message: str = "User does not have permission to access this data.",
|
message: str = "User does not have permission to access this data.",
|
||||||
|
|
@ -22,7 +25,7 @@ class UnauthorizedDataAccessError(CogneeApiError):
|
||||||
super().__init__(message, name, status_code)
|
super().__init__(message, name, status_code)
|
||||||
|
|
||||||
|
|
||||||
class DatasetNotFoundError(CogneeApiError):
|
class DatasetNotFoundError(CogneeValidationError):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
message: str = "Dataset not found.",
|
message: str = "Dataset not found.",
|
||||||
|
|
@ -32,7 +35,7 @@ class DatasetNotFoundError(CogneeApiError):
|
||||||
super().__init__(message, name, status_code)
|
super().__init__(message, name, status_code)
|
||||||
|
|
||||||
|
|
||||||
class DatasetTypeError(CogneeApiError):
|
class DatasetTypeError(CogneeValidationError):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
message: str = "Dataset type not supported.",
|
message: str = "Dataset type not supported.",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue