MCPcopy Create free account
hub / github.com/cli/cli / PrintPartialFailure

Function PrintPartialFailure

pkg/cmd/issue/artifact/shared/results.go:89–96  ·  view source on GitHub ↗

PrintPartialFailure prints the line for an artifact the command acted on while another part of its work failed, such as an artifact saved with only some of its --attach files. The line keeps status, such as "created", so a script can tell the artifact was saved and doesn't save it again. In a termin

(ios *iostreams.IOStreams, status string, r Result, message string, err error)

Source from the content-addressed store, hash-verified

87// piped line on stdout with err's reason. The command exits 1 after it, like
88// after a failure.
89func PrintPartialFailure(ios *iostreams.IOStreams, status string, r Result, message string, err error) {
90 reason := FailureReason(err)
91 if !ios.IsStdoutTTY() {
92 printResultLine(ios.Out, status, r, reason)
93 return
94 }
95 fmt.Fprintf(ios.ErrOut, "%s %s, but %s\n", ios.ColorScheme().WarningIcon(), message, reason)
96}
97
98// printResultLine prints a piped result line. Every line has all five
99// tab-separated columns, even empty ones, like gh pr checks rows.

Callers 3

createRunFunction · 0.92
editRunFunction · 0.92
TestPrintPartialFailureFunction · 0.85

Calls 5

FailureReasonFunction · 0.85
printResultLineFunction · 0.85
IsStdoutTTYMethod · 0.80
WarningIconMethod · 0.80
ColorSchemeMethod · 0.80

Tested by 1

TestPrintPartialFailureFunction · 0.68