mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 23:48:27 +00:00
Error if no servers available to join via
This commit is contained in:
parent
0c3d2f0f64
commit
2c543ac034
1 changed files with 12 additions and 0 deletions
|
@ -83,6 +83,18 @@ func (r *FederationSenderInternalAPI) PerformJoin(
|
||||||
}
|
}
|
||||||
request.ServerNames = uniqueList
|
request.ServerNames = uniqueList
|
||||||
|
|
||||||
|
// If there are no servers to join via then, well, don't bother.
|
||||||
|
if len(request.ServerNames) == 0 {
|
||||||
|
response.LastError = &gomatrix.HTTPError{
|
||||||
|
Code: 400,
|
||||||
|
Message: `{
|
||||||
|
"errcode": "M_MISSING_PARAM",
|
||||||
|
"error": "No servers were supplied in the request."
|
||||||
|
}`, // TODO: Why do none of our error types play nicely with each other?
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Try each server that we were provided until we land on one that
|
// Try each server that we were provided until we land on one that
|
||||||
// successfully completes the make-join send-join dance.
|
// successfully completes the make-join send-join dance.
|
||||||
var lastErr error
|
var lastErr error
|
||||||
|
|
Loading…
Reference in a new issue