Handle Gin private error recording

This commit is contained in:
2026-06-20 18:29:34 +02:00
committed by Milas Holsting
parent 98f6b1c6cf
commit fed837f868

View File

@@ -3,8 +3,11 @@ package handler
import (
"context"
"fmt"
"mal/internal/observability"
netutil "mal/pkg/net"
"net/http"
"github.com/gin-gonic/gin"
)
func newProxyRequest(ctx context.Context, targetURL string, referer string) (*http.Request, error) {
@@ -20,3 +23,9 @@ func newProxyRequest(ctx context.Context, targetURL string, referer string) (*ht
return req, nil
}
func recordPrivateGinError(c *gin.Context, err error) {
if recorded := c.Error(err).SetType(gin.ErrorTypePrivate); recorded == nil {
observability.WarnContext(c.Request.Context(), "gin_error_record_failed", "playback", "", nil, err)
}
}