@@ -133,7 +133,12 @@ func (m *Manager) handleCreateModel(w http.ResponseWriter, r *http.Request) {
133133 http .Error (w , "Invalid model reference" , http .StatusBadRequest )
134134 return
135135 }
136- if errors .Is (err , distribution .ErrUnauthorized ) || errors .Is (err , distribution .ErrModelNotFound ) {
136+ if errors .Is (err , distribution .ErrUnauthorized ) {
137+ m .log .Warnf ("Unauthorized to pull model %q: %v" , request .From , err )
138+ http .Error (w , "Unauthorized" , http .StatusUnauthorized )
139+ return
140+ }
141+ if errors .Is (err , distribution .ErrModelNotFound ) {
137142 m .log .Warnf ("Failed to pull model %q: %v" , request .From , err )
138143 http .Error (w , "Model not found" , http .StatusNotFound )
139144 return
@@ -369,7 +374,7 @@ func (m *Manager) handlePushModel(w http.ResponseWriter, r *http.Request, model
369374 return
370375 }
371376 if errors .Is (err , distribution .ErrUnauthorized ) {
372- m .log .Warnf ("Failed to push model %q: %v" , model , err )
377+ m .log .Warnf ("Unauthorized to push model %q: %v" , model , err )
373378 http .Error (w , "Unauthorized" , http .StatusUnauthorized )
374379 return
375380 }
0 commit comments