fix(storage): add missing selection fields to build noServerFoundError

- `STREAM_ONLY`, `PORT_FORWARD_ONLY`, `SECURE_CORE_ONLY`, `TOR_ONLY` and target ip options affected
- Refers to issue #2470
This commit is contained in:
Quentin McGaw
2024-09-28 17:47:56 +00:00
parent c450c54d67
commit 638f233b3c

View File

@@ -128,6 +128,31 @@ func noServerFoundError(selection settings.ServerSelection) (err error) {
messageParts = append(messageParts, "premium tier only")
}
if *selection.StreamOnly {
messageParts = append(messageParts, "stream only")
}
if *selection.MultiHopOnly {
messageParts = append(messageParts, "multihop only")
}
if *selection.PortForwardOnly {
messageParts = append(messageParts, "port forwarding only")
}
if *selection.SecureCoreOnly {
messageParts = append(messageParts, "secure core only")
}
if *selection.TorOnly {
messageParts = append(messageParts, "tor only")
}
if selection.TargetIP.IsValid() {
messageParts = append(messageParts,
"target ip address "+selection.TargetIP.String())
}
message := "for " + strings.Join(messageParts, "; ")
return fmt.Errorf("%w: %s", ErrNoServerFound, message)