File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -205,13 +205,21 @@ func Execute(m Metadata) {
205205 fang .WithCommit (metadata .Commit ),
206206 fang .WithErrorHandler (func (w io.Writer , styles fang.Styles , err error ) {
207207 err = util.CleanedUpSdkError {Err : err }
208+
209+ // Some subcommands intentionally suppress diagnostics for curl-like
210+ // quiet modes while still returning a non-zero exit status.
208211 var silent interface { Silent () bool }
209212 if errors .As (err , & silent ) && silent .Silent () {
210213 return
211214 }
215+
212216 // remove margins so that it matches other pterm.error "style"
213217 // we should add them back later as it looks cleaner
214218 errorTextStyle := styles .ErrorText .UnsetMargins ()
219+
220+ // Fang passes the destination for errors (normally stderr). pterm's
221+ // global Error printer does not know about it, so temporarily point
222+ // pterm at fang's writer for this handler invocation.
215223 oldErrorWriter := pterm .Error .Writer
216224 pterm .Error .Writer = w
217225 defer func () {
You can’t perform that action at this time.
0 commit comments