chore(updater): shared not enough servers error
This commit is contained in:
@@ -2,17 +2,15 @@ package perfectprivacy
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/updater/openvpn"
|
||||
)
|
||||
|
||||
var ErrNotEnoughServers = errors.New("not enough servers found")
|
||||
|
||||
func (u *Updater) GetServers(ctx context.Context, minServers int) (
|
||||
servers []models.Server, err error) {
|
||||
zipURL := url.URL{
|
||||
@@ -43,7 +41,7 @@ func (u *Updater) GetServers(ctx context.Context, minServers int) (
|
||||
|
||||
if len(cts) < minServers {
|
||||
return nil, fmt.Errorf("%w: %d and expected at least %d",
|
||||
ErrNotEnoughServers, len(cts), minServers)
|
||||
common.ErrNotEnoughServers, len(cts), minServers)
|
||||
}
|
||||
|
||||
servers = cts.toServersSlice()
|
||||
|
||||
Reference in New Issue
Block a user