Changeset 46a0f7a


Ignore:
Timestamp:
Dec 2, 2008 10:34:23 PM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
9d3e646
Parents:
769b89a
Message:

Add server debugging that prints stack traces for unanticipated internal failures.

Location:
fedd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd.py

    r769b89a r46a0f7a  
    161161
    162162    t = t.lower()
     163    sdebug = (opts.debug > 0)
    163164    try:
    164165        if t == 'soap':
    165             servers.append(server((h, p), soap_handler, ctx, impl))
     166            servers.append(server((h, p), soap_handler, ctx, impl, sdebug))
    166167        elif t == 'xmlrpc':
    167             servers.append(server((h, p), xmlrpc_handler, ctx, impl))
     168            servers.append(server((h, p), xmlrpc_handler, ctx, impl, sdebug))
    168169        else:
    169170            flog.error("Invalid transport specification (%s) in service %s" % \
  • fedd/federation/server.py

    r769b89a r46a0f7a  
    1717
    1818import logging
     19import traceback
    1920
    2021# The SSL server here is based on the implementation described at
     
    2829    Interface the fedd services to the XMLRPC and SOAP interfaces
    2930    """
    30     def __init__(self, ME, handler, ssl_ctx, impl):
     31    def __init__(self, ME, handler, ssl_ctx, impl, debug=False):
    3132        """
    3233        Create an SSL server that handles the transport in handler using the
     
    3940        self.xmlrpc_methods = impl.xmlrpc_services
    4041        self.log = logging.getLogger("fedd")
    41 
    42     def handle_error(self, request, address):
     42        if debug: self.handle_error = self.handle_error_debug
     43        else: self.handle_error = self.handle_error_standard
     44
     45    def handle_error_debug(self, request, client_address):
     46        print '-'*40
     47        traceback.print_exc()
     48        print '-'*40
     49
     50
     51    def handle_error_standard(self, request, address):
    4352        """
    4453        The default SSLServer prints a stack trace here.  This is a little
Note: See TracChangeset for help on using the changeset viewer.