Skip to content

Commit

Permalink
Merge pull request #242 from cdnjs/fix-force-endpoint
Browse files Browse the repository at this point in the history
Debug force-update endpoint
  • Loading branch information
xtuc authored Aug 19, 2021
2 parents 8510ae4 + 5f7e133 commit c4fd7ac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion functions/force-update/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ func Invoke(w http.ResponseWriter, r *http.Request) {
}

if targetVersion == nil {
http.Error(w, "target version not found", 500)
var versionNames []string
for _, version := range versions {
versionNames = append(versionNames, version.Version)
}
msg := fmt.Sprintf("target version `%s` not found: %v", d.Version, versionNames)
http.Error(w, msg, 500)
return
}
tarball := version.DownloadTar(ctx, *targetVersion)
Expand Down

0 comments on commit c4fd7ac

Please sign in to comment.