MCPcopy Index your code
hub / github.com/cli/cli / getLog

Function getLog

pkg/cmd/run/view/view.go:470–488  ·  view source on GitHub ↗
(httpClient *http.Client, logURL string)

Source from the content-addressed store, hash-verified

468}
469
470func getLog(httpClient *http.Client, logURL string) (io.ReadCloser, error) {
471 req, err := http.NewRequest("GET", logURL, nil)
472 if err != nil {
473 return nil, err
474 }
475
476 resp, err := httpClient.Do(req)
477 if err != nil {
478 return nil, err
479 }
480
481 if resp.StatusCode == 404 {
482 return nil, errors.New("log not found")
483 } else if resp.StatusCode != 200 {
484 return nil, api.HandleHTTPError(resp)
485 }
486
487 return resp.Body, nil
488}
489
490func getRunLog(cache RunLogCache, httpClient *http.Client, repo ghrepo.Interface, run *shared.Run, attempt uint64) (*zip.ReadCloser, error) {
491 cacheKey := fmt.Sprintf("%d-%d", run.ID, run.StartedTime().Unix())

Callers 1

getRunLogFunction · 0.85

Calls 2

HandleHTTPErrorFunction · 0.92
DoMethod · 0.65

Tested by

no test coverage detected