expose underlying error on embedding failure (#7743)
Avoid a round-trip asking users for logs to see what went wrong.
This commit is contained in:
parent
807ace5b1f
commit
f602ab4de4
1 changed files with 1 additions and 1 deletions
|
@ -507,7 +507,7 @@ func (s *Server) EmbeddingsHandler(c *gin.Context) {
|
||||||
embedding, err := r.Embedding(c.Request.Context(), req.Prompt)
|
embedding, err := r.Embedding(c.Request.Context(), req.Prompt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Info(fmt.Sprintf("embedding generation failed: %v", err))
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue