Changes between Initial Version and Version 1 of Ticket #11799, comment 2


Ignore:
Timestamp:
Oct 7, 2016, 5:35:46 PM (8 years ago)
Author:
Jun Omae
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11799, comment 2

    initial v1  
    11{{{#!diff
    22diff --git a/tracrpc/web_ui.py b/tracrpc/web_ui.py
    3 index d738e87..b5fe3c9 100644
     3index d738e87..f4650bf 100644
    44--- a/tracrpc/web_ui.py
    55+++ b/tracrpc/web_ui.py
     
    1313 __all__ = ['RPCWeb']
    1414
    15 @@ -168,7 +168,12 @@ class RPCWeb(Component):
     15@@ -168,7 +168,13 @@ class RPCWeb(Component):
    1616         except RequestDone :
    1717             raise
    1818         except (RPCError, PermissionError, ResourceNotFound), e:
    1919-            self.log.exception("RPC(%s) Error", proto_id)
    20 +            if isinstance(e, (PermissionError, ResourceNotFound)):
     20+            if isinstance(e, RPCError):
     21+                self.log.error("RPC(%s) [%s] Error%s", proto_id,
     22+                               req.remote_addr,
     23+                               exception_to_unicode(e, traceback=True))
     24+            else:
    2125+                self.log.warning("RPC(%s) [%s] %s", proto_id,
    2226+                                 req.remote_addr, exception_to_unicode(e))
    23 +            else:
    24 +                self.log.exception("RPC(%s) [%s] Error", proto_id,
    25 +                                   req.remote_addr)
    2627             try :
    2728                 protocol.send_rpc_error(req, e)