Skip to content
Snippets Groups Projects
Verified Commit e2991f39 authored by Gwen Le Bihan's avatar Gwen Le Bihan Committed by Ewen Le Bihan
Browse files

:sparkles: Show request body too when api error in upsertGithubRepo

parent 0258dc40
No related branches found
Tags v2.5.2
No related merge requests found
Pipeline #18513 passed
......@@ -304,8 +304,9 @@ func upsertGitHubRepo(repo map[string]interface{}, mirrorConfigUsed MirrorDefini
defer resp.Body.Close()
if resp.StatusCode >= 400 {
body, _ := io.ReadAll(resp.Body)
return "", fmt.Errorf("GitHub API error: %s: %s", resp.Status, body)
respBody, _ := io.ReadAll(resp.Body)
reqBody, _ := io.ReadAll(req.Body)
return "", fmt.Errorf("GitHub API error: %s: %s: for request: %s", resp.Status, respBody, reqBody)
}
return path, nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment