diff options
author | Simon Rozman <simon@rozman.si> | 2019-03-04 14:08:13 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-03-04 16:37:11 +0100 |
commit | a1aabb21ae83652e581ccbc0b379c2781c768932 (patch) | |
tree | aed599b46611a2a58bdce4a9999a2f7dc89be6b2 /tun | |
parent | 9041d38e2d99aa02c8c318c10b5e57a005c65a7d (diff) |
Elaborate the failing step when forwarding errors on return
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'tun')
-rw-r--r-- | tun/tun_windows.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tun/tun_windows.go b/tun/tun_windows.go index d767d79..e2752db 100644 --- a/tun/tun_windows.go +++ b/tun/tun_windows.go @@ -59,7 +59,7 @@ func CreateTUN(ifname string) (TUNDevice, error) { // Interface does not exist or an error occured. Create one. wt, _, err = wintun.CreateInterface("WireGuard Tunnel Adapter", 0) if err != nil { - return nil, err + return nil, errors.New("Creating Wintun adapter failed: " + err.Error()) } } else if err != nil { // Foreign interface with the same name found. @@ -72,13 +72,13 @@ func CreateTUN(ifname string) (TUNDevice, error) { err = wt.SetInterfaceName(ifname) if err != nil { wt.DeleteInterface(0) - return nil, err + return nil, errors.New("Setting interface name failed: " + err.Error()) } err = wt.FlushInterface() if err != nil { wt.DeleteInterface(0) - return nil, err + return nil, errors.New("Flushing interface failed: " + err.Error()) } signalNameUTF16, err := windows.UTF16PtrFromString(wt.SignalEventName()) |