{"record":{"id":"3b7e24a44ef61a22","repo":"goharbor/harbor","slug":"bad-request-3b7e24","errorCode":"BAD_REQUEST","errorMessage":"the N must be a positive int type","messagePattern":"the N must be a positive int type","errorType":"validation","errorClass":"*errors.Error","httpStatus":400,"severity":"error","filePath":"src/server/registry/catalog.go","lineNumber":50,"sourceCode":"\t\trepoMgr: pkg.RepositoryMgr,\n\t}\n}\n\ntype repositoryHandler struct {\n\trepoMgr repository.Manager\n}\n\nfunc (r *repositoryHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {\n\tvar maxEntries int\n\tvar err error\n\n\treqQ := req.URL.Query()\n\tlastEntry := reqQ.Get(\"last\")\n\twithN := reqQ.Get(\"n\") != \"\"\n\tif withN {\n\t\tmaxEntries, err = strconv.Atoi(reqQ.Get(\"n\"))\n\t\tif err != nil || maxEntries < 0 {\n\t\t\terr := errors.New(err).WithCode(errors.BadRequestCode).WithMessage(\"the N must be a positive int type\")\n\t\t\tlib_http.SendError(w, err)\n\t\t\treturn\n\t\t}\n\t}\n\n\trepoNames := make([]string, 0)\n\t// get all the non repositories\n\trepoRecords, err := r.repoMgr.NonEmptyRepos(req.Context())\n\tif err != nil {\n\t\tlib_http.SendError(w, err)\n\t\treturn\n\t}\n\tif len(repoRecords) <= 0 {\n\t\tr.sendResponse(w, req, repoNames)\n\t\treturn\n\t}\n\tfor _, repo := range repoRecords {\n\t\trepoNames = append(repoNames, repo.Name)","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/server/registry/catalog.go#L32-L68","documentation":"Error \"the N must be a positive int type\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/server/registry/catalog.go:50 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}