refactor: share package registry error status classification (#39133)

Signed-off-by: silverwind <me@silverwind.io>
This commit is contained in:
silverwind
2026-09-03 18:43:30 +00:00
committed by GitHub
parent 0fff5f481e
commit c285440e03
11 changed files with 22 additions and 62 deletions
+1 -5
View File
@@ -68,11 +68,7 @@ func GetRepositoryFile(ctx *context.Context) {
ctx.Req.Method,
)
if err != nil {
if errors.Is(err, packages_model.ErrPackageNotExist) || errors.Is(err, packages_model.ErrPackageFileNotExist) {
apiError(ctx, http.StatusNotFound, err)
} else {
apiError(ctx, http.StatusInternalServerError, err)
}
apiError(ctx, helper.PackageErrorStatus(err), err)
return
}