diff --git a/federationsender/internal/perform.go b/federationsender/internal/perform.go index a56d70ca2..831622efe 100644 --- a/federationsender/internal/perform.go +++ b/federationsender/internal/perform.go @@ -91,6 +91,8 @@ func (r *FederationSenderInternalAPI) PerformJoin( var httpErr gomatrix.HTTPError if ok := errors.As(lastErr, &httpErr); ok { httpErr.Message = string(httpErr.Contents) + // Clear the wrapped error, else serialising to JSON (in polylith mode) will fail + httpErr.WrappedError = nil response.LastError = &httpErr } else { response.LastError = &gomatrix.HTTPError{