• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(1520)  |  Call(1450)  |  Derive(0)  |  Import(70)
Format a stack trace and the exception information.

The arguments have the same meaning as the corresponding arguments
to print_exception().  The return value is a list of strings, each
ending in a newline and some containing internal newlines.  When
these lines are concatenated and printed, exactly the same text is
printed as does print_exception().

        def format_exception(etype, value, tb, limit = None):
    """Format a stack trace and the exception information.

    The arguments have the same meaning as the corresponding arguments
    to print_exception().  The return value is a list of strings, each
    ending in a newline and some containing internal newlines.  When
    these lines are concatenated and printed, exactly the same text is
    printed as does print_exception().
    """
    if tb:
        list = ['Traceback (most recent call last):\n']
        list = list + format_tb(tb, limit)
    else:
        list = []
    list = list + format_exception_only(etype, value)
    return list
        


src/z/o/Zope2-2.12.12/src/App/RefreshFuncs.py   Zope2(Download)
import os
import sys
from time import time
from traceback import format_exception
 
from ExtensionClass import Base
from Persistence import PersistentMapping
        else:
            error_type = str(exc[0])
        error_value = str(exc[1])
        info = ''.join(format_exception(exc[0], exc[1], exc[2], limit=200))
        refresh_exc_info[productid] = (error_type, error_value, info)
    finally:
        exc = None

src/n/o/notmm-0.4.1/examples/lib/payment/modules/paypal/views.py   notmm(Download)
from satchmo_store.shop.models import Order, OrderPayment
from satchmo_utils.dynamic import lookup_url, lookup_template
from sys import exc_info
from traceback import format_exception
import logging
import urllib2
 
                cart.empty()
 
    except:
        log.exception(''.join(format_exception(*exc_info())))
 
    return HttpResponse()
 

src/f/u/fuse-python-0.2/example/_find_fuse_parts.py   fuse-python(Download)
import sys, os, glob
from os.path import realpath, dirname, join
from traceback import format_exception
 
ddd = realpath(join(dirname(sys.argv[0]), '..'))
 
for d in [ddd, '.']: 
    raise RuntimeError, """
 
! Got exception:
""" + "".join([ "> " + x for x in format_exception(*sys.exc_info()) ]) + """
! Have you ran `python setup.py build'?
!
! We've done our best to find the necessary components of the FUSE bindings

src/p/u/pudb-0.92.15/pudb/debugger.py   pudb(Download)
                        try:
                            __import__(str(new_mod_name))
                        except:
                            from traceback import format_exception
                            import sys
 
                            self.message("Could not import module '%s':\n\n%s" % (
                                new_mod_name, "".join(format_exception(*sys.exc_info()))),
        def show_traceback(w, size, key):
            if self.current_exc_tuple is not None:
                from traceback import format_exception
 
                result = self.dialog(
                        urwid.ListBox([urwid.Text(
                            "".join(format_exception(*self.current_exc_tuple)))]),
            % VERSION)]
 
        if self.debugger.post_mortem:
            from traceback import format_exception
 
            self.message(
                    "The program has terminated abnormally because of an exception.\n\n"
                    "A full traceback is below. You may recall this traceback at any "
                    "time using the 'e' key. "
                    "The debugger has entered post-mortem mode and will prevent further "
                    "state changes.\n\n"
                    + "".join(format_exception(*exc_tuple)),
                    self.source[:] = format_source(self,
                            decoded_lines, set(breakpoints))
                except:
                    from traceback import format_exception
                    import sys
 
                    self.message("Could not load source file '%s':\n\n%s" % (
                        fname, "".join(format_exception(*sys.exc_info()))),
    def show_exception(self, exc_type, exc_value, traceback):
        from traceback import format_exception
 
        self.message(
                "".join(format_exception(
                    exc_type, exc_value, traceback)),
                title="Exception Occurred")

src/p/y/pymx-HEAD/pymx/backend.py   pymx(Download)
 
 
import sys
from traceback import print_exc, format_exception
from threading import RLock
 
try:
    def send_backend_error(self, exc, trace=None):
        assert self.__handled_message is not None
        self.report_error(message=format_exception(type(exc), exc, trace))
 
    def no_response(self):
        self.__has_sent_response = True
 

src/m/e/meresco-HEAD/meresco-harvester/trunk/merescoharvester/harvester/repository.py   meresco(Download)
from virtualuploader import UploaderFactory
from timeslot import Timeslot
from sys import exc_info
from traceback import format_exception
from time import localtime
from action import ActionFactory
 
def _errorMessage():
    xtype,xval,xtb = exc_info()
    return '|'.join(line.strip() for line in format_exception(xtype,xval,xtb))
 

src/m/e/meresco-HEAD/meresco-harvester/trunk/merescoharvester/harvester/deleteids.py   meresco(Download)
import sys, os
from sets import Set
from mapping import Upload
from traceback import format_exception
 
def readIds(filename):
    ids = Set()
                    done.add(id)
                except:
                    xtype,xval,xtb = sys.exc_info()
                    errorMessage = '|'.join(map(str.strip,format_exception(xtype,xval,xtb)))
                    self._eventLogger.error(errorMessage, id=id)
                    raise
            return ids - done

src/z/o/Zope2-2.12.12/src/ZPublisher/xmlrpc.py   Zope2(Download)
                vstr = re.sub(pat, " ", vstr)
            import Globals # for data
            if Globals.DevelopmentMode:
                from traceback import format_exception
                value = '\n' + ''.join(format_exception(t, vstr, tb))
            else:
                value = '%s - %s' % (t, vstr)

src/c/a/cargo-HEAD/src/python/cargo/errors.py   cargo(Download)
    stderr,
    exc_info,
    )
from traceback import (
    print_exc,
    format_exception,
    )
    def format(self):
        """
        Return a list of lines describing the exception.
        """
 
        return format_exception(self.type, self.value, self.traceback)
 

src/n/i/nipy-HEAD/nipype/trunk/nipype/pipeline/engine.py   nipy(Download)
import sys
from tempfile import mkdtemp
from time import sleep, strftime
from traceback import format_exception
from warnings import warn
 
from enthought.traits.trait_handlers import TraitDictObject, TraitListObject
        logger.error(message)
        if not traceback:
            exc_type, exc_value, exc_traceback = sys.exc_info()
            traceback = format_exception(exc_type,
                                         exc_value,
                                         exc_traceback)
        timeofcrash = strftime('%Y%m%d-%H%M%S')

  1 | 2 | 3 | 4 | 5 | 6 | 7  Next