Customizing error messages.

This commit is contained in:
Simon Forman
2021-04-09 17:41:42 -07:00
parent 810a6afdbb
commit e417842923
2 changed files with 17 additions and 5 deletions
+2 -2
View File
@@ -136,8 +136,8 @@ def interp(stack=(), dictionary=None):
stack, _, dictionary = run(text, stack, dictionary)
except UnknownSymbolError as sym:
print('Unknown:', sym)
except StackUnderflowError:
print('Not enough values on stack.')
except StackUnderflowError as e:
print(e) # 'Not enough values on stack.'
except NotAnIntError:
print('Not an integer.')
except NotAListError as e: