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

@@ -13,7 +13,6 @@ import (
var (
ErrVPNTypeNotSupported = errors.New("VPN type not supported for custom provider")
ErrExtractConnection = errors.New("cannot extract connection")
)
// GetConnection gets the connection from the OpenVPN configuration file.
@@ -34,7 +33,7 @@ func getOpenVPNConnection(extractor extract.Interface,
connection models.Connection, err error) {
_, connection, err = extractor.Data(*selection.OpenVPN.ConfFile)
if err != nil {
return connection, fmt.Errorf("%w: %s", ErrExtractConnection, err)
return connection, fmt.Errorf("cannot extract connection: %w", err)
}
connection.Port = getPort(connection.Port, selection)