Skip to content

Commit

Permalink
fix(storage): add missing selection fields to build noServerFoundError
Browse files Browse the repository at this point in the history
- `STREAM_ONLY`, `PORT_FORWARD_ONLY`, `SECURE_CORE_ONLY`, `TOR_ONLY` and target ip options affected
- Refers to issue #2470
  • Loading branch information
qdm12 committed Sep 29, 2024
1 parent c450c54 commit 638f233
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions internal/storage/formatting.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 638f233

Please sign in to comment.