diff --git a/handlers/list.go b/handlers/list.go index f870806..391ce5d 100644 --- a/handlers/list.go +++ b/handlers/list.go @@ -2,6 +2,7 @@ package handlers import ( "encoding/json" + "log" "net/http" "time" @@ -20,7 +21,7 @@ func ListFiles(client valkey.Client) http.HandlerFunc { expiresInt, err := client.Do(r.Context(), client.B().Ttl().Key(upload_id).Build()).AsInt64() if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) + http.Error(w, "not found", http.StatusNotFound) return } expiresIn := time.Second * time.Duration(expiresInt) @@ -29,7 +30,8 @@ func ListFiles(client valkey.Client) http.HandlerFunc { files_json, err := client.Do(r.Context(), client.B().Get().Key(upload_id).Build()).ToString() if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) + log.Printf("upload_id:'%s' err: %s\n", upload_id, err.Error()) + http.Error(w, "not found", http.StatusNotFound) return } @@ -37,7 +39,8 @@ func ListFiles(client valkey.Client) http.HandlerFunc { err = json.Unmarshal([]byte(files_json), &fileIds) if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) + log.Printf("upload_id:'%s' err: %s\n", upload_id, err.Error()) + http.Error(w, "not found", http.StatusInternalServerError) return }