Skip to content

Commit

Permalink
dial error
Browse files Browse the repository at this point in the history
  • Loading branch information
ainghazal committed Mar 7, 2022
1 parent d514573 commit 338242a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vpn/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/binary"
"encoding/hex"
"fmt"
"log"
"net"
"strconv"
Expand Down Expand Up @@ -77,8 +78,7 @@ func (c *Client) Dial() error {
// TODO pass context?
conn, err := net.Dial(c.Opts.Proto, net.JoinHostPort(c.Opts.Remote, c.Opts.Port))
if err != nil {
// TODO wrap this error
return err
return fmt.Errorf("%s: %w", ErrDialError, err)
}
c.con = conn
c.ctrl = newControl(conn, c.localKeySrc, c.Opts)
Expand Down
2 changes: 2 additions & 0 deletions vpn/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ var (
ErrBadKeypair = "bad keypair conf"
// ErrBadHandshake is returned when the OpenVPN handshake failed.
ErrBadHandshake = "handshake failure"
// ErrDialError
ErrDialError = "dial error"
)

0 comments on commit 338242a

Please sign in to comment.