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,8 +14,6 @@ import (
)
var (
ErrGetZip = errors.New("cannot get OpenVPN ZIP file")
ErrGetAPI = errors.New("cannot fetch server information from API")
ErrNotEnoughServers = errors.New("not enough servers found")
)
@@ -26,12 +24,12 @@ func GetServers(ctx context.Context, unzipper unzip.Unzipper,
err = addServersFromAPI(ctx, client, hts)
if err != nil {
return nil, nil, fmt.Errorf("%w: %s", ErrGetAPI, err)
return nil, nil, fmt.Errorf("cannot fetch server information from API: %w", err)
}
warnings, err = addOpenVPNServersFromZip(ctx, unzipper, hts)
if err != nil {
return nil, nil, fmt.Errorf("%w: %s", ErrGetZip, err)
return nil, nil, fmt.Errorf("cannot get OpenVPN ZIP file: %w", err)
}
getRemainingServers(hts)