Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Minor logging tweak in PatchIssue

天舟e4df201f2e09
diff --git a/server/issue.go b/server/issue.go
index 06d5c58bf2..1d772520ff 100644
--- a/server/issue.go
+++ b/server/issue.go
@@ -110,16 +110,13 @@ func (s *Server) registerIssueRoutes(g *echo.Group) {
issue, err := s.IssueService.FindIssue(context.Background(), issueFind)
if err != nil {
if bytebase.ErrorCode(err) == bytebase.ENOTFOUND {
- return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Issue ID not found: %d", id))
+ return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Unable to find issue ID to update: %d", id))
}
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to fetch issue ID when updating issue: %v", id)).SetInternal(err)
}
updatedIssue, err := s.IssueService.PatchIssue(context.Background(), issuePatch)
if err != nil {
- if bytebase.ErrorCode(err) == bytebase.ENOTFOUND {
- return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Issue ID not found: %d", id))
- }
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to update issue ID: %v", id)).SetInternal(err)
}
diff --git a/store/issue.go b/store/issue.go
index bae7493f2d..1ce26c2cbe 100644
--- a/store/issue.go
+++ b/store/issue.go
@@ -355,5 +355,5 @@ func (s *IssueService) patchIssue(ctx context.Context, tx *Tx, patch *api.IssueP
return &issue, nil
}
- return nil, &bytebase.Error{Code: bytebase.ENOTFOUND, Message: fmt.Sprintf("issue ID not found: %d", patch.ID)}
+ return nil, &bytebase.Error{Code: bytebase.ENOTFOUND, Message: fmt.Sprintf("unable to find issue ID to update: %d", patch.ID)}
}