diff options
| author | 2023-09-27 23:58:13 +0800 | |
|---|---|---|
| committer | 2023-09-27 23:58:13 +0800 | |
| commit | f0853a78a84205e7e3a6f0f3f5960750127044c6 (patch) | |
| tree | d934d8d0a67f544ce074b2030d61306299e83c5d | |
| parent | b31553864c4be0b7f475502de939e8dfad4c72af (diff) | |
| download | TRPGNivis-f0853a78a84205e7e3a6f0f3f5960750127044c6.tar.gz TRPGNivis-f0853a78a84205e7e3a6f0f3f5960750127044c6.zip | |
feat(exception): 增加语法错误基类
| -rw-r--r-- | src/psi/exception.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/psi/exception.py b/src/psi/exception.py index 838d72b..a8b7201 100644 --- a/src/psi/exception.py +++ b/src/psi/exception.py @@ -22,3 +22,15 @@ class ValueError(PsiException): 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.") + ``` + """ |
