summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2019-04-25 22:17:59 +0100
committerRichard van der Hoff <richard@matrix.org>2019-04-25 22:17:59 +0100
commit837d7f85a9d0a479487cd6205a3982f3981e4276 (patch)
tree5582da411afd7b15e8910b21edef4641b2bd26b2 /synapse
parentremove extraneous exception logging (diff)
downloadsynapse-837d7f85a9d0a479487cd6205a3982f3981e4276.tar.xz
more logging improvements
Diffstat (limited to 'synapse')
-rw-r--r--synapse/federation/federation_base.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/synapse/federation/federation_base.py b/synapse/federation/federation_base.py
index 832e2bdb9b..cffa831d80 100644
--- a/synapse/federation/federation_base.py
+++ b/synapse/federation/federation_base.py
@@ -270,13 +270,14 @@ def _check_sigs_on_pdus(keyring, room_version, pdus):
     ])
 
     def sender_err(e, pdu_to_check):
-        logger.warning(
-            "event id %s: unable to verify signature for sender %s: %s",
+        errmsg = "event id %s: unable to verify signature for sender %s: %s" % (
             pdu_to_check.pdu.event_id,
             pdu_to_check.sender_domain,
             e.getErrorMessage(),
         )
-        return e
+        # XX not really sure if these are the right codes, but they are what
+        # we've done for ages
+        raise SynapseError(400, errmsg, Codes.UNAUTHORIZED)
 
     for p, d in zip(pdus_to_check_sender, more_deferreds):
         d.addErrback(sender_err, p)
@@ -302,12 +303,14 @@ def _check_sigs_on_pdus(keyring, room_version, pdus):
         ])
 
         def event_err(e, pdu_to_check):
-            logger.warning(
-                "event id %s: unable to verify signature for event id domain: %s",
-                pdu_to_check.pdu.event_id,
-                e.getErrorMessage(),
+            errmsg = (
+                "event id %s: unable to verify signature for event id domain: %s" % (
+                    pdu_to_check.pdu.event_id,
+                    e.getErrorMessage(),
+                )
             )
-            return e
+            # XX as above: not really sure if these are the right codes
+            raise SynapseError(400, errmsg, Codes.UNAUTHORIZED)
 
         for p, d in zip(pdus_to_check_event_id, more_deferreds):
             d.addErrback(event_err, p)