Skip to content

Commit

Permalink
chore(docker): Return registry status code when not successful
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Feb 9, 2024
1 parent 5c87218 commit 8d63daf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/docker/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ func Handler(w http.ResponseWriter, r *http.Request) {

tags, err := hub.Tags(repo)
if err != nil {
var errStatus *registry.HTTPStatusError
if ok := errors.As(err, &errStatus); ok && errStatus.Response != nil {
http.Error(w, http.StatusText(errStatus.Response.StatusCode), errStatus.Response.StatusCode)
return
}
panic(err)
}

Expand Down

0 comments on commit 8d63daf

Please sign in to comment.