From 2b83f90d62fe16d2aecb8b95c780247ac364f5f3 Mon Sep 17 00:00:00 2001 From: tdakkota Date: Sat, 2 Dec 2023 08:40:29 +0300 Subject: [PATCH] fix(gen): add missing feature check --- gen/_template/handlers.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gen/_template/handlers.tmpl b/gen/_template/handlers.tmpl index b08b495b7..29873809b 100644 --- a/gen/_template/handlers.tmpl +++ b/gen/_template/handlers.tmpl @@ -101,7 +101,7 @@ func (s *{{ if $op.WebhookInfo }}Webhook{{ end }}Server) handle{{ $op.Name }}Req Err: err, } {{- if and $.Config.Error (not $op.WebhookInfo) }} - if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil { + if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, {{ if $otel }}span{{ end }}); encodeErr != nil { recordError({{ printf "Security:%s" $securityName | quote }}, err) } {{- else }} @@ -140,7 +140,7 @@ func (s *{{ if $op.WebhookInfo }}Webhook{{ end }}Server) handle{{ $op.Name }}Req Err: ogenerrors.ErrSecurityRequirementIsNotSatisfied, } {{- if and $.Config.Error (not $op.WebhookInfo) }} - if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil { + if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, {{ if $otel }}span{{ end }}); encodeErr != nil { recordError({{ quote "Security" }}, err) } {{- else }}