From b31553864c4be0b7f475502de939e8dfad4c72af Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Wed, 27 Sep 2023 23:57:13 +0800 Subject: feat(exception): 添加PsiException 异常基类 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/psi/exception.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src') diff --git a/src/psi/exception.py b/src/psi/exception.py index e69de29..838d72b 100644 --- a/src/psi/exception.py +++ b/src/psi/exception.py @@ -0,0 +1,24 @@ +class PsiException(Exception): + """ + An exception class for Psi-specific exceptions. + + This class inherits from the built-in `Exception` class. + + Example: + ```python + raise PsiException("An error occurred in the Psi code.") + ``` + """ + + +class ValueError(PsiException): + """ + An exception class for value-related errors in Psi code. + + This class inherits from the `PsiException` class. + + Example: + ```python + raise ValueError("Invalid value encountered in the Psi code.") + ``` + """ -- cgit v1.2.3-70-g09d2