From fed837f868a892c87ea01f28c6a269e1e78d80e5 Mon Sep 17 00:00:00 2001 From: mkelvers Date: Sat, 20 Jun 2026 18:29:34 +0200 Subject: [PATCH] Handle Gin private error recording --- internal/playback/handler/proxy_request.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/playback/handler/proxy_request.go b/internal/playback/handler/proxy_request.go index 871f021..ce004b8 100644 --- a/internal/playback/handler/proxy_request.go +++ b/internal/playback/handler/proxy_request.go @@ -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) + } +}