From fadd10602afbcc451f830cde7099e7fc23c56b17 Mon Sep 17 00:00:00 2001 From: maru Date: Thu, 9 May 2024 14:26:54 -0400 Subject: [PATCH] Don't log ErrNoRows in savedata --- api/endpoints.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/endpoints.go b/api/endpoints.go index ee4f76d..3515f4f 100644 --- a/api/endpoints.go +++ b/api/endpoints.go @@ -18,6 +18,7 @@ package api import ( + "database/sql" "encoding/json" "fmt" "net/http" @@ -280,6 +281,10 @@ func handleSaveData(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case "/savedata/get": save, err = savedata.Get(uuid, datatype, slot) + if err == sql.ErrNoRows { + http.Error(w, err.Error(), http.StatusNotFound) + return + } case "/savedata/update": err = savedata.Update(uuid, slot, save) case "/savedata/delete":