aboutsummaryrefslogtreecommitdiff
path: root/federationapi
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-06-23 10:31:17 +0100
committerGitHub <noreply@github.com>2020-06-23 10:31:17 +0100
commit02565c37aa2a03b31b3bd7447c9a8ab90a6cd9e7 (patch)
treeb8ddc059c829d02f071c224f059dc87fdf7cad3c /federationapi
parenta1352cbd9ed156da546ac67ae5194b30f607fed6 (diff)
/send auth errors are silent (#1149)
* /send auth errors are silent * Fix test
Diffstat (limited to 'federationapi')
-rw-r--r--federationapi/routing/send.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go
index cf71b8ba..c80ab89f 100644
--- a/federationapi/routing/send.go
+++ b/federationapi/routing/send.go
@@ -176,9 +176,17 @@ func (t *txnReq) processTransaction() (*gomatrixserverlib.RespSend, error) {
util.GetLogger(t.context).Warnf("Processing %s failed fatally: %s", e.EventID(), err)
return nil, err
} else {
- util.GetLogger(t.context).WithError(err).WithField("event_id", e.EventID()).Warn("Failed to process incoming federation event, skipping")
+ // Auth errors mean the event is 'rejected' which have to be silent to appease sytest
+ _, rejected := err.(*gomatrixserverlib.NotAllowed)
+ errMsg := err.Error()
+ if rejected {
+ errMsg = ""
+ }
+ util.GetLogger(t.context).WithError(err).WithField("event_id", e.EventID()).WithField("rejected", rejected).Warn(
+ "Failed to process incoming federation event, skipping",
+ )
results[e.EventID()] = gomatrixserverlib.PDUResult{
- Error: err.Error(),
+ Error: errMsg,
}
}
} else {