Add all exceptions & errors

This commit is contained in:
Peter Stockings
2025-10-29 23:15:23 +11:00
parent 6b19192a99
commit 2f1cdea2ea

View File

@@ -59,7 +59,37 @@ def execute_code(code, request_obj, environment):
'pow': pow, 'range': range, 'repr': repr, 'reversed': reversed,
'round': round, 'set': set, 'slice': slice, 'sorted': sorted,
'str': str, 'sum': sum, 'super': super, 'tuple': tuple, 'type': type,
'zip': zip,'Exception': Exception,
'zip': zip,
'BaseException': BaseException,
'Exception': Exception,
'ArithmeticError': ArithmeticError,
'AssertionError': AssertionError,
'AttributeError': AttributeError,
'EOFError': EOFError,
'FloatingPointError': FloatingPointError,
'GeneratorExit': GeneratorExit,
'ImportError': ImportError,
'IndexError': IndexError,
'KeyError': KeyError,
'KeyboardInterrupt': KeyboardInterrupt,
'LookupError': LookupError,
'MemoryError': MemoryError,
'NameError': NameError,
'NotImplementedError': NotImplementedError,
'OSError': OSError,
'OverflowError': OverflowError,
'RecursionError': RecursionError,
'ReferenceError': ReferenceError,
'RuntimeError': RuntimeError,
'StopIteration': StopIteration,
'StopAsyncIteration': StopAsyncIteration,
'SyntaxError': SyntaxError,
'SystemError': SystemError,
'TypeError': TypeError,
'UnboundLocalError': UnboundLocalError,
'UnicodeError': UnicodeError,
'ValueError': ValueError,
'ZeroDivisionError': ZeroDivisionError
},
'request': request_obj,
'environment': environment,