chore(updater): shared not enough servers error

This commit is contained in:
Quentin McGaw
2022-05-28 22:02:18 +00:00
parent eb18eaf0a9
commit 22455ac76f
20 changed files with 60 additions and 91 deletions

View File

@@ -4,15 +4,11 @@ package ivpn
import (
"context"
"errors"
"fmt"
"github.com/qdm12/gluetun/internal/constants/vpn"
"github.com/qdm12/gluetun/internal/models"
)
var (
ErrNotEnoughServers = errors.New("not enough servers found")
"github.com/qdm12/gluetun/internal/provider/common"
)
func (u *Updater) GetServers(ctx context.Context, minServers int) (
@@ -38,7 +34,7 @@ func (u *Updater) GetServers(ctx context.Context, minServers int) (
if len(hosts) < minServers {
return nil, fmt.Errorf("%w: %d and expected at least %d",
ErrNotEnoughServers, len(hosts), minServers)
common.ErrNotEnoughServers, len(hosts), minServers)
}
hostToIPs, warnings, err := resolveHosts(ctx, u.presolver, hosts, minServers)