Handle Gin private error recording

This commit is contained in:
2026-06-20 18:29:34 +02:00
parent fcfabd0980
commit 47d3c17570

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)
}
}