diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2020-05-27 11:16:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-27 11:16:27 +0100 |
commit | 406b47267eca9e1be2f63b6c18f598e98618e7a0 (patch) | |
tree | c03b05a612d9b115e0b1cca7dfcf15d353b32da2 /federationapi/routing/send.go | |
parent | a7f12bce79436fab14ed97ba1cb049384e1e3522 (diff) |
Return 500 when processing a transaction fails fatally (#1066)
Diffstat (limited to 'federationapi/routing/send.go')
-rw-r--r-- | federationapi/routing/send.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index 6cf44018..b514af0a 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -76,6 +76,7 @@ func Send( resp, err := t.processTransaction() if err != nil { util.GetLogger(httpReq.Context()).WithError(err).Error("t.processTransaction failed") + return util.ErrorResponse(err) } // https://matrix.org/docs/spec/server_server/r0.1.3#put-matrix-federation-v1-send-txnid @@ -117,7 +118,7 @@ type txnFederationClient interface { func (t *txnReq) processTransaction() (*gomatrixserverlib.RespSend, error) { results := make(map[string]gomatrixserverlib.PDUResult) - var pdus []gomatrixserverlib.HeaderedEvent + pdus := []gomatrixserverlib.HeaderedEvent{} for _, pdu := range t.PDUs { var header struct { RoomID string `json:"room_id"` |