diff options
| author | mryouse | 2022-06-05 03:06:12 +0000 |
|---|---|---|
| committer | mryouse | 2022-06-05 03:06:12 +0000 |
| commit | 86104621edc9758155909e0b6e7b9822190815fc (patch) | |
| tree | 572e8720273daa75e93da50c75808d046ceae3d8 /exceptions.py | |
| parent | ed78cd23f92b8b96dd7ffa3313be2262b0b29ff0 (diff) | |
refactor: better error messages
Diffstat (limited to 'exceptions.py')
| -rw-r--r-- | exceptions.py | 10 |
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) + |
