(self, e)
Handle a BASIC error through trapping.
Handle a BASIC error through trapping.
Handle a BASIC error through trapping .
def trap_error(self, e):
        """Handle a BASIC error through trapping."""
        if e.pos is None:
            if self.run_mode:
                e.pos = self._program_code.tell()-1
            else:
                e.pos = -1
        self.error_num = e.err
        self.error_pos = e.pos
        # don't jump if we're already busy handling an error
        if self.on_error is not None and self.on_error != 0 and not self.error_handle_mode:
            self.error_resume = self.current_statement, self.run_mode
            self.jump(self.on_error)
            self.error_handle_mode = True
            self._basic_events.suspend_all = True
        else:
            self.error_handle_mode = False
            self.set_pointer(False)
            raise e
def trap_error ( self , e ) : if e . pos is None : if self . run_mode : e . pos = self . _program_code . tell ( ) - 1 else : e . pos = - 1 self . error_num = e . err self . error_pos = e . pos # don't jump if we're already busy handling an error if self . on_error is not None and self . on_error != 0 and not self . error_handle_mode : self . error_resume = self . current_statement , self . run_mode self . jump ( self . on_error ) self . error_handle_mode = True self . _basic_events . suspend_all = True else : self . error_handle_mode = False self . set_pointer ( False ) raise e