Loads exception data from the current exception frame - should be called inside the except block
        :return:
337367
def load(self, cause=None, do_message=True):
        
        if cause is not None:
            self.cause = cause
            if do_message:
                self.message = error_message(self, self.base_message, cause)

        self.exc_type, self.exc_value, self.exc_traceback = sys.exc_info()
        self.traceback_formatted = traceback.format_exc()
        self.traceback = traceback.extract_tb(self.exc_traceback)
792350
def _from_exception(cls, pe):
        
        return cls(pe.pstr, pe.loc, pe.msg, pe.parserElement)
1126965
def _loadError(ErrorType, thrownError, tracebackString):
    ''''''
    RemoteException = asRemoteException(ErrorType)
    return RemoteException(thrownError, tracebackString)
1004276
def get_exception_information(self, index):
        
        if index < 0 or index > win32.EXCEPTION_MAXIMUM_PARAMETERS:
            raise IndexError("Array index out of range: %s" % repr(index))
        info = self.raw.u.Exception.ExceptionRecord.ExceptionInformation
        value = info[index]
        if value is None:
            value = 0
        return value
902764
def exception(self, *exceptions):
        

        def response(handler):
            for exception in exceptions:
                if isinstance(exception, (tuple, list)):
                    for e in exception:
                        self.error_handler.add(e, handler)
                else:
                    self.error_handler.add(exception, handler)
            return handler

        return response
958096
def exception(self):
        ''''''
        code, _, message = self.data.partition(' ')
        return self.find(code)(message)
914585
private ExceptionSet computeThrownExceptionTypes(BasicBlock basicBlock) throws
    DataflowAnalysisException {

        ExceptionSet exceptionTypeSet = exceptionSetFactory.createExceptionSet();
        InstructionHandle pei = basicBlock.getExceptionThrower();
        Instruction ins = pei.getInstruction();

        // Get the exceptions that BCEL knows about.
        // Note that all of these are unchecked.
        ExceptionThrower exceptionThrower = (ExceptionThrower) ins;
        Class<?>[] exceptionList = exceptionThrower.getExceptions();
        for (Class<?> aExceptionList : exceptionList) {
            exceptionTypeSet.addImplicit(ObjectTypeFactory.getInstance(aExceptionList.getName()));
        }

        // Assume that an Error may be thrown by any instruction.
        exceptionTypeSet.addImplicit(Hierarchy.ERROR_TYPE);

        if (ins instanceof ATHROW) {
            // For ATHROW instructions, we generate *two* blocks
            // for which the ATHROW is an exception thrower.
            //
            // - The first, empty basic block, does the null check
            // - The second block, which actually contains the ATHROW,
            // throws the object on the top of the operand stack
            //
            // We make a special case of the block containing the ATHROW,
            // by removing all of the implicit exceptions,
            // and using type information to figure out what is thrown.

            if (basicBlock.containsInstruction(pei)) {
                // This is the actual ATHROW, not the null check
                // and implicit exceptions.
                exceptionTypeSet.clear();

                // The frame containing the thrown value is the start fact
                // for the block, because ATHROW is guaranteed to be
                // the only instruction in the block.
                TypeFrame frame = getStartFact(basicBlock);

                // Check whether or not the frame is valid.
                // Sun's javac sometimes emits unreachable code.
                // For example, it will emit code that follows a JSR
                // subroutine call that never returns.
                // If the frame is invalid, then we can just make
                // a conservative assumption that anything could be
                // thrown at this ATHROW.
                if (!frame.isValid()) {
                    exceptionTypeSet.addExplicit(Type.THROWABLE);
                } else if (frame.getStackDepth() == 0) {
                    throw new IllegalStateException("empty stack " + " thrown by " + pei + " in "
                            + SignatureConverter.convertMethodSignature(methodGen));
                } else {

                    Type throwType = frame.getTopValue();
                    if (throwType instanceof ObjectType) {
                        exceptionTypeSet.addExplicit((ObjectType) throwType);
                    } else if (throwType instanceof ExceptionObjectType) {
                        exceptionTypeSet.addAll(((ExceptionObjectType) throwType).getExceptionSet());
                    } else {
                        // Not sure what is being thrown here.
                        // Be conservative.
                        if (DEBUG) {
                            System.out.println("Non object type " + throwType + " thrown by " + pei + " in "
                                    + SignatureConverter.convertMethodSignature(methodGen));
                        }
                        exceptionTypeSet.addExplicit(Type.THROWABLE);
                    }
                }
            }
        }

        // If it's an InvokeInstruction, add declared exceptions and
        // RuntimeException
        if (ins instanceof InvokeInstruction) {
            ConstantPoolGen cpg = methodGen.getConstantPool();

            InvokeInstruction inv = (InvokeInstruction) ins;
            ObjectType[] declaredExceptionList = Hierarchy2.findDeclaredExceptions(inv, cpg);
            if (declaredExceptionList == null) {
                // Couldn't find declared exceptions,
                // so conservatively assume it could thrown any checked
                // exception.
                if (DEBUG) {
                    System.out.println("Couldn't find declared exceptions for "
                            + SignatureConverter.convertMethodSignature(inv, cpg));
                }
                exceptionTypeSet.addExplicit(Hierarchy.EXCEPTION_TYPE);
            } else {
                for (ObjectType aDeclaredExceptionList : declaredExceptionList) {
                    exceptionTypeSet.addExplicit(aDeclaredExceptionList);
                }
            }

            exceptionTypeSet.addImplicit(Hierarchy.RUNTIME_EXCEPTION_TYPE);
        }

        if (DEBUG) {
            System.out.println(pei + " can throw " + exceptionTypeSet);
        }

        return exceptionTypeSet;
    }
108428
def _fault_to_exception(f):
    

    e = _fault_to_exception_map.get(f.faultCode)
    if e is None:
        e = NipapError
    return e(f.faultString)
462139
def _printTraceback(self, test, err):
        
        # Don't bind third item to a local var; that can create
        # circular refs which are expensive to collect. See the
        # sys.exc_info() docs.
        exception_type, exception_value = err[:2]
        # TODO: In Python 3, the traceback is attached to the exception
        # instance through the __traceback__ attribute. If the instance
        # is saved in a local variable that persists outside the except
        # block, the traceback will create a reference cycle with the
        # current frame and its dictionary of local variables. This will
        # delay reclaiming dead resources until the next cyclic garbage
        # collection pass.

        extracted_tb = extract_relevant_tb(
            err[2],
            exception_type,
            exception_type is test.failureException)
        test_frame_index = index_of_test_frame(
            extracted_tb,
            exception_type,
            exception_value,
            test)
        if test_frame_index:
            # We have a good guess at which frame is the test, so
            # trim everything until that. We don't care to see test
            # framework frames.
            extracted_tb = extracted_tb[test_frame_index:]

        with self.bar.dodging():
            self.stream.write(''.join(
                format_traceback(
                    extracted_tb,
                    exception_type,
                    exception_value,
                    self._cwd,
                    self._term,
                    self._options.function_color,
                    self._options.dim_color,
                    self._options.editor,
                    self._options.editor_shortcut_template)))
196127
def catch(self, exceptions):  # pylint: disable=redefined-outer-name
        
        if self.type is None or exceptions is None:
            return True
        for node in self.type._get_name_nodes():
            if node.name in exceptions:
                return True
        return False
619299
def future_exceptions(context, rrevent=None):
    
    request = context['request']
    if rrevent is None:
        rrevent = context.get('page')
    if rrevent:
        exceptions = rrevent._futureExceptions(request)
    else:
        exceptions = []
    return {'request':    request,
            'exceptions': exceptions}
475558
def __get_exception_message(self):
        
        exception_info = sys.exc_info()[1]
        if hasattr(exception_info, 'msg'):
            exc_message = exception_info.msg
        elif hasattr(exception_info, 'message'):
            exc_message = exception_info.message
        else:
            exc_message = '(Unknown Exception)'
        return exc_message
100270
def exceptionToString(e):
    """"""
    exc_type, exc_obj, exc_tb = sys.exc_info()
    s="EXCEPTION THROWN UNEXPECTEDLY"
    s+="  FILE: %s\n"%os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
    s+="  LINE: %s\n"%exc_tb.tb_lineno
    s+="  TYPE: %s\n"%exc_type
    return s
1146535
def create_exception(self, code):
        
        frame = deepcopy(self)
        frame.length = 3
        frame.fcode += 0x80
        frame.data = bytearray(chr(code))
        return frame
153039
def on_exceptioninfo_request(self, py_db, request):
        '''
        
        '''
        # : :type exception_into_arguments: ExceptionInfoArguments
        exception_into_arguments = request.arguments
        thread_id = exception_into_arguments.threadId
        max_frames = int(self._debug_options['args'].get('maxExceptionStackFrames', 0))
        self.api.request_exception_info_json(py_db, request, thread_id, max_frames)
215572
def handle_exception(self, frame, exc_info):
        """"""
        type_, value, tb = exc_info
        # Python 3 is broken see http://bugs.python.org/issue17413
        _value = value
        if not isinstance(_value, BaseException):
            _value = type_(value)
        fake_exc_info = type_, _value, tb
        log.error('Exception during trace', exc_info=fake_exc_info)
        self.obj_cache[id(exc_info)] = exc_info
        self.extra_vars['__exception__'] = exc_info
        exception = type_.__name__
        exception_description = str(value)
        init = 'Echo|%s' % dump({
            'for': '__exception__',
            'val': escape('%s: %s') % (exception, exception_description)
        })
        # User exception is 4 frames away from exception
        frame = frame or sys._getframe().f_back.f_back.f_back.f_back
        self.interaction(
            frame, tb, exception, exception_description, init=init
        )
936316
def user_exception(self, frame, exc_info):
        """"""
        exc_type, exc_value, exc_traceback = exc_info
        frame.f_locals['__exception__'] = exc_type, exc_value

        # An 'Internal StopIteration' exception is an exception debug event
        # issued by the interpreter when handling a subgenerator run with
        # 'yield from' or a generator controled by a for loop. No exception has
        # actually occured in this case. The debugger uses this debug event to
        # stop when the debuggee is returning from such generators.
        prefix = 'Internal ' if (PY34 and not exc_traceback
                                    and exc_type is StopIteration) else ''
        self.message('--Exception--\n%s%s' % (prefix,
            traceback.format_exception_only(exc_type, exc_value)[-1].strip()))
        self.interaction(frame, exc_traceback)