Skip to content
Snippets Groups Projects
Commit c7bf1f08085e authored by Christophe de Vienne's avatar Christophe de Vienne
Browse files

template-varlist: Fix internal error responses

parent 2f2261ad2e7b
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,6 @@
"context"
"errors"
"fmt"
"net/http"
"github.com/Masterminds/squirrel"
"github.com/go-openapi/runtime/middleware"
......@@ -85,6 +84,8 @@
// Handle the incoming request.
func (h *TemplateVarlistHandler) Handle(params op.TemplateVarlistParams, principals *models.Principal) middleware.Responder {
log := zerolog.Ctx(params.HTTPRequest.Context())
varlist, err := h.handle(
params.HTTPRequest.Context(),
params.Request,
......@@ -100,9 +101,7 @@
return r
}
return op.
NewTemplateVarlistDefault(http.StatusInternalServerError).
WithPayload(models.FromError(err))
return InternalError(err, log, false)
}
return op.NewTemplateVarlistOK().WithPayload(varlist)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment