all: replace UserVisibleError with vizerror package

Updates tailscale/corp#9025

Signed-off-by: Will Norris <will@tailscale.com>
This commit is contained in:
Will Norris
2023-02-16 10:46:52 -08:00
committed by Will Norris
parent 4044e05dfd
commit a8204568d8
4 changed files with 8 additions and 13 deletions
-6
View File
@@ -91,9 +91,3 @@ type Client interface {
// distinguish one client from another.
ClientID() int64
}
// UserVisibleError is an error that should be shown to users.
type UserVisibleError string
func (e UserVisibleError) Error() string { return string(e) }
func (e UserVisibleError) UserVisibleError() string { return string(e) }
+2 -1
View File
@@ -59,6 +59,7 @@ import (
"tailscale.com/util/syspolicy/pkey"
"tailscale.com/util/syspolicy/policyclient"
"tailscale.com/util/testenv"
"tailscale.com/util/vizerror"
"tailscale.com/util/zstdframe"
)
@@ -743,7 +744,7 @@ func (c *Direct) doLogin(ctx context.Context, opt loginOpt) (mustRegen bool, new
resp.NodeKeyExpired, resp.MachineAuthorized, resp.AuthURL != "")
if resp.Error != "" {
return false, "", nil, UserVisibleError(resp.Error)
return false, "", nil, vizerror.New(resp.Error)
}
if len(resp.NodeKeySignature) > 0 {
return true, "", resp.NodeKeySignature, nil