-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Add error handling to hash util
Added error handling to reading of file in hash util Refactor COG-505
- Loading branch information
Showing
3 changed files
with
37 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
""" | ||
Custom exceptions for the Cognee API. | ||
This module defines a set of exceptions for handling various shared utility errors | ||
""" | ||
|
||
from .exceptions import ( | ||
IngestionError, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from cognee.exceptions import CogneeApiError | ||
from fastapi import status | ||
|
||
class IngestionError(CogneeApiError): | ||
def __init__( | ||
self, | ||
message: str = "Failed to load data.", | ||
name: str = "IngestionError", | ||
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, | ||
): | ||
super().__init__(message, name, status_code) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters