Changeset 46a0f7a for fedd/federation


Ignore:
Timestamp:
Dec 2, 2008 10:34:23 PM (16 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.