diff --git a/cli/root.go b/cli/root.go index 5d9ed5590f3a3..f0bae8ff75adb 100644 --- a/cli/root.go +++ b/cli/root.go @@ -1116,7 +1116,16 @@ func formatCoderSDKError(from string, err *codersdk.Error, opts *formatOpts) str //nolint:errorlint func traceError(err error) string { if uw, ok := err.(interface{ Unwrap() error }); ok { - a, b := err.Error(), uw.Unwrap().Error() + var a, b string + if err != nil { + a = err.Error() + } + if uw != nil { + uwerr := uw.Unwrap() + if uwerr != nil { + b = uwerr.Error() + } + } c := strings.TrimSuffix(a, b) return c }
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: