Skip to content

Commit 2ac5c17

Browse files
committed
always print traec
1 parent 4066e2c commit 2ac5c17

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

cli/root.go

+4-8
Original file line numberDiff line numberDiff line change
@@ -1109,10 +1109,7 @@ func formatMultiError(from string, multi []error, opts *formatOpts) string {
11091109

11101110
// Write errors out
11111111
var str strings.Builder
1112-
var traceMsg string
1113-
if opts.Verbose {
1114-
traceMsg = fmt.Sprintf("Trace=[%s])", from)
1115-
}
1112+
traceMsg := fmt.Sprintf("Trace=[%s])", from)
11161113
_, _ = str.WriteString(pretty.Sprint(headLineStyle(), fmt.Sprintf("%d errors encountered: %s", len(multi), traceMsg)))
11171114
for i, errStr := range errorStrings {
11181115
// Indent each error
@@ -1160,11 +1157,10 @@ func formatCoderSDKError(from string, err *codersdk.Error, opts *formatOpts) str
11601157
if opts.Verbose {
11611158
_, _ = str.WriteString(pretty.Sprint(headLineStyle(), fmt.Sprintf("API request error to \"%s:%s\". Status code %d", err.Method(), err.URL(), err.StatusCode())))
11621159
_, _ = str.WriteString("\n")
1163-
if from != "" {
1164-
_, _ = str.WriteString(pretty.Sprint(headLineStyle(), fmt.Sprintf("Trace=[%s]", from)))
1165-
_, _ = str.WriteString("\n")
1166-
}
11671160
}
1161+
// Always include this trace. Users can ignore this.
1162+
_, _ = str.WriteString(pretty.Sprint(headLineStyle(), fmt.Sprintf("Trace=[%s]", from)))
1163+
_, _ = str.WriteString("\n")
11681164

11691165
_, _ = str.WriteString(pretty.Sprint(headLineStyle(), err.Message))
11701166
if err.Helper != "" {

0 commit comments

Comments
 (0)