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:
parent
62310a5a09
commit
9150081892
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue