chore(errors): review all errors in codebase

This commit is contained in:
Quentin McGaw
2022-02-20 02:58:16 +00:00
parent ac4a4f83fc
commit 920ad8b54b
88 changed files with 254 additions and 460 deletions

View File

@@ -14,7 +14,6 @@ import (
)
var (
ErrFetchAPI = errors.New("failed fetching API")
ErrNotEnoughServers = errors.New("not enough servers found")
)
@@ -23,7 +22,7 @@ func GetServers(ctx context.Context, client *http.Client,
servers []models.IvpnServer, warnings []string, err error) {
data, err := fetchAPI(ctx, client)
if err != nil {
return nil, nil, fmt.Errorf("%w: %s", ErrFetchAPI, err)
return nil, nil, fmt.Errorf("failed fetching API: %w", err)
}
hosts := make([]string, 0, len(data.Servers))