From db0968f30c895b9f2059da48800018739ef9bca7 Mon Sep 17 00:00:00 2001 From: Josh <76125168+joshyan1@users.noreply.github.com> Date: Mon, 22 Jul 2024 15:48:15 -0700 Subject: [PATCH] fix dupe err message (#5857) --- server/routes.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/routes.go b/server/routes.go index 0d7ca003..e6ffe526 100644 --- a/server/routes.go +++ b/server/routes.go @@ -609,10 +609,9 @@ func (s *Server) CreateModelHandler(c *gin.Context) { defer cancel() quantization := cmp.Or(r.Quantize, r.Quantization) - if err := CreateModel(ctx, name, filepath.Dir(r.Path), strings.ToUpper(quantization), f, fn); err != nil { - if errors.Is(err, errBadTemplate) { - ch <- gin.H{"error": err.Error(), "status": http.StatusBadRequest} - } + if err := CreateModel(ctx, name, filepath.Dir(r.Path), strings.ToUpper(quantization), f, fn); errors.Is(err, errBadTemplate) { + ch <- gin.H{"error": err.Error(), "status": http.StatusBadRequest} + } else if err != nil { ch <- gin.H{"error": err.Error()} } }()