Skip to content

Commit 5408de7

Browse files
authored
fix(api): improve error message for file not found in GetAgentSkillFile (#500)
Previously, when a skill file was not found, the API returned: - HTTP 404 status code - Generic "database error" message (from serializer.DBErr) This was confusing because: 1. The user didn't know if it was a database issue or file missing 2. "database error" sounds like a server-side problem Now it returns: - HTTP 404 status code - Clear "file not found" message This helps users understand that the requested file simply doesn't exist in the skill, rather than encountering a database error.
1 parent d5973b0 commit 5408de7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/server/api/go/internal/modules/handler/agent_skills.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ func (h *AgentSkillsHandler) GetAgentSkillFile(c *gin.Context) {
272272
output, err := h.svc.GetFile(c.Request.Context(), project.ID, id, filePath, expire)
273273
if err != nil {
274274
if strings.Contains(err.Error(), "not found") {
275-
c.JSON(http.StatusNotFound, serializer.DBErr("", err))
275+
c.JSON(http.StatusNotFound, serializer.Err(http.StatusNotFound, "file not found", err))
276276
} else {
277277
c.JSON(http.StatusInternalServerError, serializer.DBErr("", err))
278278
}

0 commit comments

Comments
 (0)