1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

return 404 when not found

This commit is contained in:
Kwonunn 2025-03-20 14:35:26 +01:00 committed by Kwonunn
parent 62310a5a09
commit 9150081892

View file

@ -391,7 +391,7 @@ func (h *Handler) get(w http.ResponseWriter, r *http.Request, params httprouter.
defer db.Close() defer db.Close()
if err := db.Get(id, cache); err != nil { if err := db.Get(id, cache); err != nil {
if errors.Is(err, bolthold.ErrNotFound) { if errors.Is(err, bolthold.ErrNotFound) {
h.responseJSON(w, r, 400, fmt.Errorf("cache %d: not reserved", id)) h.responseJSON(w, r, 404, fmt.Errorf("cache %d: not reserved", id))
return return
} }
h.responseJSON(w, r, 500, err) h.responseJSON(w, r, 500, err)