diff --git a/federationsender/internal/perform.go b/federationsender/internal/perform.go index 623e7cb8..4e1e9320 100644 --- a/federationsender/internal/perform.go +++ b/federationsender/internal/perform.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "net/http" "time" "github.com/matrix-org/dendrite/federationsender/api" @@ -115,6 +116,12 @@ func (r *FederationSenderInternalAPI) PerformJoin( // Clear the wrapped error, else serialising to JSON (in polylith mode) will fail httpErr.WrappedError = nil response.LastError = &httpErr + } else if na, ok := lastErr.(*gomatrixserverlib.NotAllowed); ok { + response.LastError = &gomatrix.HTTPError{ + Code: http.StatusForbidden, + WrappedError: na, + Message: na.Message, + } } else { response.LastError = &gomatrix.HTTPError{ Code: 0,