diff options
Diffstat (limited to 'neb/exceptions.py')
| -rw-r--r-- | neb/exceptions.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/neb/exceptions.py b/neb/exceptions.py index cc0f915..c34097a 100644 --- a/neb/exceptions.py +++ b/neb/exceptions.py @@ -3,7 +3,10 @@ class NebPanic(BaseException): class InterpretPanic(NebPanic): def __init__(self, sym, msg, arg=None): - big_message = f"[{sym.line}] '{sym.name}': {msg}" + if hasattr(sym, "line"): + big_message = f"[{sym.line}] '{sym.name}': {msg}" + else: + big_message = f"[??] '{sym.name}': {msg}" if arg is not None: big_message += f" (got {arg})" super().__init__(big_message) |
