Handle unauthorized error
Signed-off-by: Emily Casey <emily.casey@docker.com>
This commit is contained in:
parent
fdf81fe571
commit
43fdb4cd50
|
|
@ -368,6 +368,11 @@ func (m *Manager) handlePushModel(w http.ResponseWriter, r *http.Request, model
|
||||||
http.Error(w, "Model not found", http.StatusNotFound)
|
http.Error(w, "Model not found", http.StatusNotFound)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if errors.Is(err, distribution.ErrUnauthorized) {
|
||||||
|
m.log.Warnf("Failed to push model %q: %v", model, err)
|
||||||
|
http.Error(w, "Unauthorized", http.StatusUnauthorized)
|
||||||
|
return
|
||||||
|
}
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue