mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-10 00:51:07 +00:00
util/vizerror: add As function to get wrapped Error
Signed-off-by: Will Norris <will@tailscale.com>
This commit is contained in:
@@ -42,3 +42,9 @@ func Wrap(err error) error {
|
||||
}
|
||||
return Error{err}
|
||||
}
|
||||
|
||||
// As returns the first vizerror.Error in err's chain.
|
||||
func As(err error) (e Error, ok bool) {
|
||||
ok = errors.As(err, &e)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user