{"record":{"id":"f491ba900a4c3bb7","repo":"goharbor/harbor","slug":"bad-request-f491ba","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/util/util.go","lineNumber":70,"sourceCode":"\t\tsort.Strings(strs)\n\t}\n\ti := sort.Search(len(strs), func(i int) bool { return x <= strs[i] })\n\tif i < len(strs) && strs[i] == x {\n\t\treturn i\n\t}\n\treturn -1\n}\n\n// ParseNAndLastParameters parse the n and last parameters from the query of the http request\nfunc ParseNAndLastParameters(r *http.Request) (*int, string, error) {\n\tq := r.URL.Query()\n\n\tvar n *int\n\n\tif q.Get(\"n\") != \"\" {\n\t\tvalue, err := strconv.Atoi(q.Get(\"n\"))\n\t\tif err != nil || value < 0 {\n\t\t\treturn nil, \"\", errors.New(err).WithCode(errors.BadRequestCode).WithMessage(\"the N must be a positive int type\")\n\t\t}\n\n\t\tn = &value\n\t}\n\n\treturn n, q.Get(\"last\"), nil\n}\n\n// SendListTagsResponse sends the response for list tags API\nfunc SendListTagsResponse(w http.ResponseWriter, r *http.Request, tags []string) {\n\tn, last, err := ParseNAndLastParameters(r)\n\tif err != nil {\n\t\tlibhttp.SendError(w, err)\n\t\treturn\n\t}\n\n\titems, nextLast := pickItems(sortedAndUniqueItems(tags), n, last)\n","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/server/registry/util/util.go#L52-L88","documentation":"Error \"the N must be a positive int type\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/server/registry/util/util.go:70 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"}