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


Ignore:
Timestamp:
Oct 7, 2016, 6:08:03 PM (8 years ago)
Author:
Jun Omae
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11799, comment 2

    v1 v2  
    11{{{#!diff
    22diff --git a/tracrpc/web_ui.py b/tracrpc/web_ui.py
    3 index d738e87..f4650bf 100644
     3index d738e87..3fd77d6 100644
    44--- a/tracrpc/web_ui.py
    55+++ b/tracrpc/web_ui.py
     
    1313 __all__ = ['RPCWeb']
    1414
    15 @@ -168,7 +168,13 @@ class RPCWeb(Component):
     15@@ -158,7 +158,7 @@ class RPCWeb(Component):
     16                 result = (XMLRPCSystem(self.env).get_method(method_name)(req, args))[0]
     17                 if isinstance(result, GeneratorType):
     18                     result = list(result)
     19-            except (RPCError, PermissionError, ResourceNotFound), e:
     20+            except (TracError, PermissionError, ResourceNotFound), e:
     21                 raise
     22             except Exception:
     23                 e, tb = sys.exc_info()[-2:]
     24@@ -167,8 +167,9 @@ class RPCWeb(Component):
     25                 protocol.send_rpc_result(req, result)
    1626         except RequestDone :
    1727             raise
    18          except (RPCError, PermissionError, ResourceNotFound), e:
     28-        except (RPCError, PermissionError, ResourceNotFound), e:
    1929-            self.log.exception("RPC(%s) Error", proto_id)
    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:
    25 +                self.log.warning("RPC(%s) [%s] %s", proto_id,
    26 +                                 req.remote_addr, exception_to_unicode(e))
     30+        except (TracError, PermissionError, ResourceNotFound), e:
     31+            self.log.warning("RPC(%s) [%s] %s", proto_id, req.remote_addr,
     32+                             exception_to_unicode(e))
    2733             try :
    2834                 protocol.send_rpc_error(req, e)