Don't log ErrNoRows in savedata
parent
e4de7c2391
commit
fadd10602a
|
@ -18,6 +18,7 @@
|
||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"database/sql"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -280,6 +281,10 @@ func handleSaveData(w http.ResponseWriter, r *http.Request) {
|
||||||
switch r.URL.Path {
|
switch r.URL.Path {
|
||||||
case "/savedata/get":
|
case "/savedata/get":
|
||||||
save, err = savedata.Get(uuid, datatype, slot)
|
save, err = savedata.Get(uuid, datatype, slot)
|
||||||
|
if err == sql.ErrNoRows {
|
||||||
|
http.Error(w, err.Error(), http.StatusNotFound)
|
||||||
|
return
|
||||||
|
}
|
||||||
case "/savedata/update":
|
case "/savedata/update":
|
||||||
err = savedata.Update(uuid, slot, save)
|
err = savedata.Update(uuid, slot, save)
|
||||||
case "/savedata/delete":
|
case "/savedata/delete":
|
||||||
|
|
Loading…
Reference in New Issue