From f602ab4de44756ebffa74a1e3c6e6bd0f3febab3 Mon Sep 17 00:00:00 2001 From: Daniel Hiltgen Date: Tue, 19 Nov 2024 16:26:05 -0800 Subject: [PATCH] expose underlying error on embedding failure (#7743) Avoid a round-trip asking users for logs to see what went wrong. --- server/routes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/routes.go b/server/routes.go index f5b05bb5..5dfd6ffe 100644 --- a/server/routes.go +++ b/server/routes.go @@ -507,7 +507,7 @@ func (s *Server) EmbeddingsHandler(c *gin.Context) { embedding, err := r.Embedding(c.Request.Context(), req.Prompt) if err != nil { slog.Info(fmt.Sprintf("embedding generation failed: %v", err)) - c.JSON(http.StatusInternalServerError, gin.H{"error": "failed to generate embedding"}) + c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Errorf("failed to generate embedding: %v", err)}) return }