Raise error for invalid relay (#2128)

* Raise error for invalid relay

* Keep error messages the same

* Distinguish this from validation failed
This commit is contained in:
lifenjoiner 2022-06-15 19:16:06 +08:00 committed by GitHub
parent 0a0b69d93d
commit 72a602577a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -467,8 +467,9 @@ func route(proxy *Proxy, name string, serverProto stamps.StampProtoType) (*Relay
}
}
if len(relayStamps) == 0 {
dlog.Warnf("Empty relay set for [%v]", name)
return nil, nil
err := fmt.Errorf("Non-existent relay set for server [%v]", name)
dlog.Warn(err)
return nil, err
}
var relayCandidateStamp *stamps.ServerStamp
if !wildcard || len(relayStamps) == 1 {