more logging improvements

This commit is contained in:
Richard van der Hoff 2019-04-25 22:17:59 +01:00
parent fd8fb32bdd
commit 837d7f85a9
1 changed files with 11 additions and 8 deletions

View File

@ -270,13 +270,14 @@ def _check_sigs_on_pdus(keyring, room_version, pdus):
]) ])
def sender_err(e, pdu_to_check): def sender_err(e, pdu_to_check):
logger.warning( errmsg = "event id %s: unable to verify signature for sender %s: %s" % (
"event id %s: unable to verify signature for sender %s: %s",
pdu_to_check.pdu.event_id, pdu_to_check.pdu.event_id,
pdu_to_check.sender_domain, pdu_to_check.sender_domain,
e.getErrorMessage(), 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): for p, d in zip(pdus_to_check_sender, more_deferreds):
d.addErrback(sender_err, p) 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): def event_err(e, pdu_to_check):
logger.warning( errmsg = (
"event id %s: unable to verify signature for event id domain: %s", "event id %s: unable to verify signature for event id domain: %s" % (
pdu_to_check.pdu.event_id, pdu_to_check.pdu.event_id,
e.getErrorMessage(), 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): for p, d in zip(pdus_to_check_event_id, more_deferreds):
d.addErrback(event_err, p) d.addErrback(event_err, p)