forked from langgenius/dify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(knowledge-retrieval): improve error handling with custom exc…
…eptions (langgenius#10385)
- Loading branch information
Showing
2 changed files
with
35 additions
and
10 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,18 @@ | ||
class KnowledgeRetrievalNodeError(ValueError): | ||
"""Base class for KnowledgeRetrievalNode errors.""" | ||
|
||
|
||
class ModelNotExistError(KnowledgeRetrievalNodeError): | ||
"""Raised when the model does not exist.""" | ||
|
||
|
||
class ModelCredentialsNotInitializedError(KnowledgeRetrievalNodeError): | ||
"""Raised when the model credentials are not initialized.""" | ||
|
||
|
||
class ModelNotSupportedError(KnowledgeRetrievalNodeError): | ||
"""Raised when the model is not supported.""" | ||
|
||
|
||
class ModelQuotaExceededError(KnowledgeRetrievalNodeError): | ||
"""Raised when the model provider quota is exceeded.""" |
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