Get the exception info
        Sample usage:
            try:
                raise Exception("asdfsdfsdf")
            except:
                print common.get_exception_error()
        Return:
            return the exception infomation.
6770
def get_exception_error():
        ''' 
        '''
        error_message = ""
        for i in range(len(inspect.trace())):
            error_line = u"""
        File:      %s - [%s]
        Function:  %s
        Statement: %s
        -""" % (inspect.trace()[i][1], inspect.trace()[i][2], inspect.trace()[i][3], inspect.trace()[i][4])
            
            error_message = "%s%s" % (error_message, error_line)    
        
        error_message = u"""Error!\n%s\n\t%s\n\t%s\n-------------------------------------------------------------------------------------------\n\n""" % (error_message,sys.exc_info()[0], sys.exc_info()[1])
        
        return error_message
825060
def capture_exception(self, error=None):
        # type: (Optional[BaseException]) -> Optional[str]
        
        client = self.client
        if client is None:
            return None
        if error is None:
            exc_info = sys.exc_info()
        else:
            exc_info = exc_info_from_error(error)

        event, hint = event_from_exception(exc_info, client_options=client.options)
        try:
            return self.capture_event(event, hint=hint)
        except Exception:
            self._capture_internal_exception(sys.exc_info())

        return None
1366521
def handle_api_exception(f):
    
    def wraps(self, *args, **kwargs):
        try:
            return f(self, *args, **kwargs)
        except SupersetSecurityException as e:
            logging.exception(e)
            return json_error_response(utils.error_msg_from_exception(e),
                                       status=e.status,
                                       stacktrace=traceback.format_exc(),
                                       link=e.link)
        except SupersetException as e:
            logging.exception(e)
            return json_error_response(utils.error_msg_from_exception(e),
                                       stacktrace=traceback.format_exc(),
                                       status=e.status)
        except Exception as e:
            logging.exception(e)
            return json_error_response(utils.error_msg_from_exception(e),
                                       stacktrace=traceback.format_exc())
    return functools.update_wrapper(wraps, f)
5034
def exceptionToString(e,silent=False):
    """"""
    exc_type, exc_obj, exc_tb = sys.exc_info()
    s=("\n"+"="*50+"\n")
    s+="EXCEPTION THROWN UNEXPECTEDLY\n"
    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
    s+='-'*50+'\n'
    s+=traceback.format_exc()
    s=s.strip()+'\n'+"="*50+"\n"
    if not silent:
        print(s)
    return s
35198
def get_error(self):
        """"""
        exc_info = sys.exc_info()
        if exc_info[0] is None:
            return None
        else:
            err_type, err_value, err_trace = exc_info[0], exc_info[1], None
            if self.verbose and len(exc_info) > 2:
                err_trace = exc_info[2]
            return format_error(err_type, err_value, err_trace)
720929
def api_exception(e):
    
    _, _, exc_traceback = sys.exc_info()
    tb = '\n'.join(traceback.format_tb(exc_traceback))
    return {
        400: BadRequestError,
        401: UnauthorizedError,
        403: ForbiddenError,
        404: NotFoundError,
        405: MethodNotAllowedError,
        409: ConflictError,
        410: GoneError,
        422: UnprocessibleEntityError,
        429: TooManyRequestsError,
        500: InternalServerError,
        503: ServiceUnavailableError,
        504: ServerTimeoutError,
    }.get(e.status, DynamicApiError)(e, tb)
401446
def get_exception(self):
        # type: () -> Optional[Tuple[Any, Any, Any]]
        
        with self.__lock:
            return (
                self.__updateexception
                if self.__updateexception or self.__closed
                else self.__exportref.get_exception()
            )
803400
private String getExceptionMessage(Throwable pException) {
        String message = pException.getLocalizedMessage();
        return pException.getClass().getName() + (message != null ? " : " + message : "");
    }
1249818
def make_exception_message(exc):
    
    if str(exc):
        return '%s: %s\n' % (exc.__class__.__name__, exc)
    else:
        return '%s\n' % (exc.__class__.__name__)
563295
public String getErrorString() {
        StringBuffer ret = new StringBuffer();
        String linesep = System.getProperty("line.separator");

        List<Exception> exc = getExceptions();
        if (exc != null && exc.size() != 0) {

            // ret.append(HBCIUtils.getLocMsg("STAT_EXCEPTIONS")).append(":").append(linesep);
            for (Iterator<Exception> j = exc.iterator(); j.hasNext(); ) {
                ret.append(HBCIUtils.exception2StringShort(j.next()));
                ret.append(linesep);
            }
        }

        HBCIDialogStatus status = getDialogStatus();
        if (status != null) {
            String errMsg = status.getErrorString();
            if (errMsg.length() != 0) {
                ret.append(errMsg + linesep);
            }
        }

        return ret.toString().trim();
    }
984336
@SuppressWarnings("rawtypes")
  public Class getException() {
    try {
      return Class.forName(errorParam, true, Thread.currentThread().getContextClassLoader()).newInstance().getClass();
    } catch (Exception e) {
      return null;
    }
  }
973889
def exception_info(current_filename=None, index=-1):
    ""
    # guardo el traceback original (por si hay una excepción):
    info = sys.exc_info() #         exc_type, exc_value, exc_traceback
    # importante: no usar unpacking porque puede causar memory leak
    if not current_filename:
        # genero un call stack para ver quien me llamó y limitar la traza: 
        # advertencia: esto es necesario ya que en py2exe no tengo __file__ 
        try:
            raise ZeroDivisionError
        except ZeroDivisionError:
            f = sys.exc_info()[2].tb_frame.f_back
        current_filename = os.path.normpath(os.path.abspath(f.f_code.co_filename))

    # extraer la última traza del archivo solicitado:
    # (útil para no alargar demasiado la traza con lineas de las librerías)
    ret = {'filename': "", 'lineno': 0, 'function_name': "", 'code': ""}
    try:
        for (filename, lineno, fn, text) in traceback.extract_tb(info[2]):
            if os.path.normpath(os.path.abspath(filename)) == current_filename:
                ret = {'filename': filename, 'lineno': lineno, 
                       'function_name': fn, 'code': text}
    except Exception, e:
        pass
    # obtengo el mensaje de excepcion tal cual lo formatea python:
    # (para evitar errores de encoding)
    try:
        ret['msg'] = traceback.format_exception_only(*info[0:2])[0]
    except: 
        ret['msg'] = '<no disponible>'
    # obtener el nombre de la excepcion (ej. "NameError")
    try:
        ret['name'] = info[0].__name__
    except:
        ret['name'] = 'Exception'
    # obtener la traza formateada como string:
    try:
        tb = traceback.format_exception(*info)
        ret['tb'] = ''.join(tb)
    except:
        ret['tb'] = ""
    return ret
60392
def init_soap_exception(self, exc):
        
        if not isinstance(exc, urllib2.HTTPError):
            return SoapException(unicode(exc), exc)

        if isinstance(exc, urllib2.HTTPError):
            try:
                data = exc.read()
                self.log.debug(data)

                t = SOAPpy.Parser.parseSOAP(data)
                message = '%s:%s' % (t.Fault.faultcode, t.Fault.faultstring)
                e = SoapException(message, exc)
                e.code = t.Fault.detail.Error.Code
                e.trace = t.Fault.detail.Error.Trace
                return e
            except:
                return SoapException(unicode(exc), exc)

        return SoapException(exc.reason, exc)
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
900811
public static String getExceptionMessage(Throwable exception)
    {
        StringWriter        out = new StringWriter();
        exception.printStackTrace(new PrintWriter(out));
        BufferedReader      in = new BufferedReader(new StringReader(out.toString()));
        try
        {
            StringBuilder       str = new StringBuilder();
            for(;;)
            {
                String  line = in.readLine();
                if ( line == null )
                {
                    break;
                }
                if ( str.length() > 0 )
                {
                    str.append(", ");
                }
                str.append(line);
            }
            return str.toString();
        }
        catch ( IOException e )
        {
            // ignore
        }
        return "n/a";
    }
384971
def determineException(vm, m):
    
    # no exceptions !
    if m.get_code().get_tries_size() <= 0:
        return []

    h_off = {}

    handler_catch_list = m.get_code().get_handlers()

    for try_item in m.get_code().get_tries():
        offset_handler = try_item.get_handler_off(
        ) + handler_catch_list.get_off()
        if offset_handler in h_off:
            h_off[offset_handler].append([try_item])
        else:
            h_off[offset_handler] = []
            h_off[offset_handler].append([try_item])

    # print m.get_name(), "\t HANDLER_CATCH_LIST SIZE", handler_catch_list.size, handler_catch_list.get_offset()
    for handler_catch in handler_catch_list.get_list():
        if handler_catch.get_off() not in h_off:
            continue

        for i in h_off[handler_catch.get_off()]:
            i.append(handler_catch)

    exceptions = []
    # print m.get_name(), h_off
    for i in h_off:
        for value in h_off[i]:
            try_value = value[0]

            z = [try_value.get_start_addr() * 2,
                 (try_value.get_start_addr() * 2) +
                 (try_value.get_insn_count() * 2) - 1]

            handler_catch = value[1]
            if handler_catch.get_size() <= 0:
                z.append(["Ljava/lang/Throwable;",
                          handler_catch.get_catch_all_addr() * 2])

            for handler in handler_catch.get_handlers():
                z.append([vm.get_cm_type(handler.get_type_idx()),
                          handler.get_addr() * 2])

            exceptions.append(z)

    # print m.get_name(), exceptions
    return exceptions
284250
def GetErrorHandler(self):
        """"""
        f,arg = libxml2mod.xmlTextReaderGetErrorHandler(self._o)
        if f is None:
            return None,None
        else:
            # assert f is _xmlTextReaderErrorFunc
            return arg