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 @@ ...@@ -4,7 +4,6 @@
"context" "context"
"errors" "errors"
"fmt" "fmt"
"net/http"
"github.com/Masterminds/squirrel" "github.com/Masterminds/squirrel"
"github.com/go-openapi/runtime/middleware" "github.com/go-openapi/runtime/middleware"
...@@ -85,6 +84,8 @@ ...@@ -85,6 +84,8 @@
// Handle the incoming request. // Handle the incoming request.
func (h *TemplateVarlistHandler) Handle(params op.TemplateVarlistParams, principals *models.Principal) middleware.Responder { func (h *TemplateVarlistHandler) Handle(params op.TemplateVarlistParams, principals *models.Principal) middleware.Responder {
log := zerolog.Ctx(params.HTTPRequest.Context())
varlist, err := h.handle( varlist, err := h.handle(
params.HTTPRequest.Context(), params.HTTPRequest.Context(),
params.Request, params.Request,
...@@ -100,9 +101,7 @@ ...@@ -100,9 +101,7 @@
return r return r
} }
return op. return InternalError(err, log, false)
NewTemplateVarlistDefault(http.StatusInternalServerError).
WithPayload(models.FromError(err))
} }
return op.NewTemplateVarlistOK().WithPayload(varlist) 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