micropython

docs/exceptions.txt

230:892b13f1cba4
2009-05-30 Paul Boddie Changed instantiator invocation reserving a frame slot regardless of whether the target is known in advance. In the instantiator, the first frame slot is then overwritten with the new instance, and the RecoverFrame instruction is no longer required. Instead, a new JumpInFrame instruction maintains the existing locals, jumping to the initialiser method for the class. Updated various tests, renaming and enhancing the classes test.
     1 Exception Handling
     2 ------------------
     3 
     4 An exception handler stack is defined such that when a try...except or
     5 try...finally block is entered, a new handler is defined.
     6 
     7 When an exception is raised, the program jumps to the most recently defined
     8 handler. Inside the handler, the stack entry for the handler will be removed.
     9 
    10 Depending on the nature of the handler and whether the exception is handled,
    11 the program may jump to the next most recent handler, and so on.
    12 
    13 If no handler is defined when an exception is raised or re-raised, the program
    14 should terminate. This might be done by having a "handler #0" which explicitly
    15 terminates the program.