From 8793ecea74706aedb4674434f65ef9d05850b769 Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Wed, 28 Feb 2024 12:09:56 +0800 Subject: refactor(bones)!: rename nivis-python -> nivis_python --- nivis_python/exception.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 nivis_python/exception.py (limited to 'nivis_python/exception.py') diff --git a/nivis_python/exception.py b/nivis_python/exception.py new file mode 100644 index 0000000..0ec22e5 --- /dev/null +++ b/nivis_python/exception.py @@ -0,0 +1,37 @@ +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.") + ``` + """ -- cgit v1.2.3-70-g09d2