Пример #1
0
    def should_stop_on_exception(self, frame, event, arg):
        mainDebugger, _filename, info, thread = self._args
        flag = False

        if info.pydev_state != STATE_SUSPEND:  #and breakpoint is not None:
            exception, value, trace = arg

            if trace is not None: #on jython trace is None on the first event
                exception_breakpoint = get_exception_breakpoint(
                    exception, mainDebugger.break_on_caught_exceptions)

                if exception_breakpoint is not None:
                    if not exception_breakpoint.notify_on_first_raise_only or just_raised(trace):
                        # print frame.f_code.co_name
                        add_exception_to_frame(frame, (exception, value, trace))
                        thread.additionalInfo.message = exception_breakpoint.qname
                        flag = True
                    else:
                        flag = False
                else:
                    try:
                        result = mainDebugger.plugin_exception_break(self, frame, event, self._args, arg)
                        if result:
                            (flag, frame) = result

                    except:
                        flag = False

        return flag, frame
Пример #2
0
    def should_stop_on_exception(self, frame, event, arg):
        mainDebugger, _filename, info, thread = self._args
        flag = False

        if info.pydev_state != STATE_SUSPEND:  #and breakpoint is not None:
            exception, value, trace = arg

            if trace is not None:  #on jython trace is None on the first event
                exception_breakpoint = get_exception_breakpoint(
                    exception, mainDebugger.break_on_caught_exceptions)

                if exception_breakpoint is not None:
                    if not exception_breakpoint.notify_on_first_raise_only or just_raised(
                            trace):
                        # print frame.f_code.co_name
                        add_exception_to_frame(frame,
                                               (exception, value, trace))
                        thread.additionalInfo.message = exception_breakpoint.qname
                        flag = True
                    else:
                        flag = False
                else:
                    try:
                        result = mainDebugger.plugin.exception_break(
                            mainDebugger, self, frame, self._args, arg)
                        if result:
                            (flag, frame) = result

                    except:
                        flag = False

        return flag, frame
Пример #3
0
    def should_stop_on_exception(self, frame, event, arg):
        mainDebugger, _filename, info, thread = self._args
        flag = False

        if info.pydev_state != STATE_SUSPEND:  #and breakpoint is not None:
            exception, value, trace = arg

            if trace is not None:  #on jython trace is None on the first event
                exception_breakpoint = get_exception_breakpoint(
                    exception, mainDebugger.break_on_caught_exceptions)

                if exception_breakpoint is not None:
                    if not exception_breakpoint.notify_on_first_raise_only or just_raised(
                            trace):
                        # print frame.f_code.co_name
                        add_exception_to_frame(frame,
                                               (exception, value, trace))
                        thread.additionalInfo.message = exception_breakpoint.qname
                        flag = True
                    else:
                        flag = False
                else:
                    try:
                        if mainDebugger.django_exception_break and get_exception_name(exception) in [
                                'VariableDoesNotExist', 'TemplateDoesNotExist', 'TemplateSyntaxError'] \
                                and just_raised(trace) and is_django_exception_break_context(frame):

                            render_frame = find_django_render_frame(frame)
                            if render_frame:
                                suspend_frame = suspend_django(
                                    self, mainDebugger, thread, render_frame,
                                    CMD_ADD_DJANGO_EXCEPTION_BREAK)

                                if suspend_frame:
                                    add_exception_to_frame(
                                        suspend_frame,
                                        (exception, value, trace))
                                    flag = True
                                    thread.additionalInfo.message = 'VariableDoesNotExist'
                                    suspend_frame.f_back = frame
                                    frame = suspend_frame
                    except:
                        flag = False

        return flag, frame
Пример #4
0
    def should_stop_on_exception(self, frame, event, arg):
        mainDebugger, _filename, info, thread = self._args
        flag = False

        if info.pydev_state != STATE_SUSPEND:  #and breakpoint is not None:
            exception, value, trace = arg

            if trace is not None: #on jython trace is None on the first event
                exception_breakpoint = get_exception_breakpoint(
                    exception, mainDebugger.break_on_caught_exceptions)

                if exception_breakpoint is not None:
                    if not exception_breakpoint.notify_on_first_raise_only or just_raised(trace):
                        # print frame.f_code.co_name
                        add_exception_to_frame(frame, (exception, value, trace))
                        thread.additionalInfo.message = exception_breakpoint.qname
                        flag = True
                    else:
                        flag = False
                else:
                    try:
                        if mainDebugger.django_exception_break and get_exception_name(exception) in [
                                'VariableDoesNotExist', 'TemplateDoesNotExist', 'TemplateSyntaxError'] \
                                and just_raised(trace) and is_django_exception_break_context(frame):

                            render_frame = find_django_render_frame(frame)
                            if render_frame:
                                suspend_frame = suspend_django(
                                    self, mainDebugger, thread, render_frame, CMD_ADD_DJANGO_EXCEPTION_BREAK)

                                if suspend_frame:
                                    add_exception_to_frame(suspend_frame, (exception, value, trace))
                                    flag = True
                                    thread.additionalInfo.message = 'VariableDoesNotExist'
                                    suspend_frame.f_back = frame
                                    frame = suspend_frame
                    except :
                        flag = False

        return flag, frame
    def should_stop_on_exception(self, frame, event, arg):
        mainDebugger, _filename, info, thread = self._args
        flag = False

        if info.pydev_state != STATE_SUSPEND:  # and breakpoint is not None:
            exception, value, trace = arg

            if trace is not None:  # on jython trace is None on the first event
                exception_breakpoint = get_exception_breakpoint(exception, mainDebugger.break_on_caught_exceptions)

                if exception_breakpoint is not None:
                    if exception_breakpoint.ignore_libraries:
                        if exception_breakpoint.notify_on_first_raise_only:
                            if mainDebugger.first_appearance_in_scope(trace):
                                add_exception_to_frame(frame, (exception, value, trace))
                                thread.additionalInfo.message = exception_breakpoint.qname
                                flag = True
                            else:
                                pydev_log.debug(
                                    "Ignore exception %s in library %s" % (exception, frame.f_code.co_filename)
                                )
                                flag = False
                    else:
                        if not exception_breakpoint.notify_on_first_raise_only or just_raised(trace):
                            add_exception_to_frame(frame, (exception, value, trace))
                            thread.additionalInfo.message = exception_breakpoint.qname
                            flag = True
                        else:
                            flag = False
                else:
                    try:
                        if mainDebugger.plugin is not None:
                            result = mainDebugger.plugin.exception_break(mainDebugger, self, frame, self._args, arg)
                            if result:
                                (flag, frame) = result
                    except:
                        flag = False

        return flag, frame