aboutsummaryrefslogtreecommitdiff
path: root/exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'exceptions.py')
-rw-r--r--exceptions.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/exceptions.py b/exceptions.py
new file mode 100644
index 0000000..98395ac
--- /dev/null
+++ b/exceptions.py
@@ -0,0 +1,10 @@
+class NebPanic(BaseException):
+ pass
+
+class InterpretPanic(NebPanic):
+ def __init__(self, sym, msg, arg=None):
+ big_message = f"[{sym.line}] '{sym.name}': {msg}"
+ if arg is not None:
+ big_message += f" ({arg})"
+ super().__init__(big_message)
+