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

Function printFailure

pkg/cmd/issue/artifact/delete/delete.go:181–187  ·  view source on GitHub ↗

printFailure reports an artifact gh couldn't delete, on stderr. In a terminal, it's the failure line the other artifact commands print. Piped, it's " : ", like gh codespace delete, with the same reason.

(ios *iostreams.IOStreams, number int, err error)

Source from the content-addressed store, hash-verified

179// terminal, it's the failure line the other artifact commands print. Piped,
180// it's "<number>: <reason>", like gh codespace delete, with the same reason.
181func printFailure(ios *iostreams.IOStreams, number int, err error) {
182 if !ios.IsStdoutTTY() {
183 fmt.Fprintf(ios.ErrOut, "%d: %s\n", number, shared.FailureReason(err))
184 return
185 }
186 shared.PrintFailure(ios, shared.Result{Number: number}, fmt.Sprintf("delete artifact %d", number), err)
187}
188
189// confirmationPrompt asks once for every artifact, naming each one, such as
190// "Delete artifacts 2 (OAuth callback plan) and 5 (Barista feedback notes)

Callers 1

deleteRunFunction · 0.85

Calls 3

FailureReasonFunction · 0.92
PrintFailureFunction · 0.92
IsStdoutTTYMethod · 0.80

Tested by

no test coverage detected