Skip to content

Commit

Permalink
expose underlying error on embedding failure (ollama#7743)
Browse files Browse the repository at this point in the history
Avoid a round-trip asking users for logs to see what went wrong.
  • Loading branch information
dhiltgen authored Nov 20, 2024
1 parent 807ace5 commit f602ab4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit f602ab4

Please sign in to comment.