log 404s and other log improvements.

This commit is contained in:
fiatjaf
2024-10-06 15:56:20 -03:00
parent a5dac15262
commit 84b81654f0
9 changed files with 14 additions and 10 deletions

View File

@@ -55,8 +55,9 @@ func renderOEmbed(w http.ResponseWriter, r *http.Request) {
data, err := grabData(ctx, code)
if err != nil {
w.Header().Set("Cache-Control", "max-age=60")
http.Error(w, "error fetching event: "+err.Error(), 404)
w.Header().Set("Cache-Control", "max-age=180")
log.Warn().Err(err).Str("code", code).Msg("event not found on oembed")
http.Error(w, "error fetching event: "+err.Error(), http.StatusNotFound)
return
}