Skip to content

Commit e6bb211

Browse files
committed
Handle unauthorized error
Signed-off-by: Emily Casey <[email protected]>
1 parent a5c0c31 commit e6bb211

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/inference/models/manager.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,11 @@ func (m *Manager) handlePushModel(w http.ResponseWriter, r *http.Request, model
368368
http.Error(w, "Model not found", http.StatusNotFound)
369369
return
370370
}
371+
if errors.Is(err, distribution.ErrUnauthorized) {
372+
m.log.Warnf("Failed to push model %q: %v", model, err)
373+
http.Error(w, "Unauthorized", http.StatusUnauthorized)
374+
return
375+
}
371376
http.Error(w, err.Error(), http.StatusInternalServerError)
372377
return
373378
}

0 commit comments

Comments
 (0)