Return remote errors from FS.PerformJoin (#1164)

* Return remote errors from FS.PerformJoin

Follows the same pattern as PerformJoin on roomserver (no error return).

Also return the right format for incompatible room version errors.

Makes a bunch of tests pass!

* Handle network errors better when returning remote HTTP errors

* Linting

* Fix tests

* Update whitelist, pass network errors through in API=1 mode
This commit is contained in:
Kegsay 2020-06-25 15:04:48 +01:00 committed by GitHub
parent c2d34422d6
commit 43cddfe00f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 83 additions and 21 deletions

View file

@ -4,6 +4,7 @@ import (
"context"
"github.com/matrix-org/dendrite/federationsender/types"
"github.com/matrix-org/gomatrix"
"github.com/matrix-org/gomatrixserverlib"
)
@ -28,7 +29,7 @@ type FederationSenderInternalAPI interface {
ctx context.Context,
request *PerformJoinRequest,
response *PerformJoinResponse,
) error
)
// Handle an instruction to make_leave & send_leave with a remote server.
PerformLeave(
ctx context.Context,
@ -62,6 +63,7 @@ type PerformJoinRequest struct {
}
type PerformJoinResponse struct {
LastError *gomatrix.HTTPError
}
type PerformLeaveRequest struct {