From 638f233b3ca1ad21567a5ba795da181cacb36325 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Sat, 28 Sep 2024 17:47:56 +0000 Subject: [PATCH] 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 --- internal/storage/formatting.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/internal/storage/formatting.go b/internal/storage/formatting.go index 2a3c7d38..aaebba80 100644 --- a/internal/storage/formatting.go +++ b/internal/storage/formatting.go @@ -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)