@@ -615,21 +615,33 @@ func (httpsvc *HttpService) ApiPrintClusterInformation(w http.ResponseWriter, r
615615 log .WithError (err ).Warn ("Error, could not marshal inventory." )
616616 }
617617 }
618- fmt .Fprintln (w , string (result ))
618+ _ , err = fmt .Fprintln (w , string (result ))
619+ if err != nil {
620+ log .WithError (err ).Warn ("Error, could not write response." )
621+ }
619622 case "text" :
620623 fallthrough
621624 default :
622625 w .Header ().Set ("Content-Type" , "text/plain" )
623626 w .WriteHeader (http .StatusOK )
624627 if hosts != nil {
625628 for _ , hostname := range hosts {
626- fmt .Fprintf (w , "%s\n " , hostname )
629+ _ , err := fmt .Fprintf (w , "%s\n " , hostname )
630+ if err != nil {
631+ log .WithError (err ).Warn ("Error, could not write response." )
632+ }
627633 }
628634 } else if inventory != nil {
629635 for detector , flps := range inventory {
630- fmt .Fprintf (w , "%s\n " , detector )
636+ _ , err := fmt .Fprintf (w , "%s\n " , detector )
637+ if err != nil {
638+ log .WithError (err ).Warn ("Error, could not write response." )
639+ }
631640 for _ , hostname := range flps {
632- fmt .Fprintf (w , "\t %s\n " , hostname )
641+ _ , err = fmt .Fprintf (w , "\t %s\n " , hostname )
642+ if err != nil {
643+ log .WithError (err ).Warn ("Error, could not write response." )
644+ }
633645 }
634646 }
635647 }
0 commit comments