diff options
| author | 2023-09-28 00:09:06 +0800 | |
|---|---|---|
| committer | 2023-09-28 00:09:06 +0800 | |
| commit | 719b598e98baff2cf5ea34bb6d36eddd8fd29f38 (patch) | |
| tree | 5ec396376f3e85d10cd14a7222979105060b3926 /psi/exception.py | |
| parent | f0853a78a84205e7e3a6f0f3f5960750127044c6 (diff) | |
| download | TRPGNivis-719b598e98baff2cf5ea34bb6d36eddd8fd29f38.tar.gz TRPGNivis-719b598e98baff2cf5ea34bb6d36eddd8fd29f38.zip | |
feat(src): delete `src` dir & rename `psi` dir
feat(frame): 添加`Lib` `Grammar` `Modules` 目录
Diffstat (limited to 'psi/exception.py')
| -rw-r--r-- | psi/exception.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/psi/exception.py b/psi/exception.py new file mode 100644 index 0000000..a8b7201 --- /dev/null +++ b/psi/exception.py @@ -0,0 +1,36 @@ +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.") + ``` + """ + +class GrammarError(PsiException): + """ + An exception class for grammar-related errors in Psi code. + + This class inherits from the `PsiException` class. + + Example: + ```python + raise GrammarError("Invalid grammar encountered in the Psi code.") + ``` + """ |
