{"record":{"id":"c96c55977af9f796","repo":"cli/cli","slug":"invalid-url-q","errorCode":null,"errorMessage":"invalid URL: %q","messagePattern":"invalid URL: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/pr/shared/finder.go","lineNumber":308,"sourceCode":"\t\t\terr := api.ProjectsV2ItemsForPullRequest(apiClient, f.baseRefRepo, pr)\n\t\t\tif err != nil && !api.ProjectsV2IgnorableError(err) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t}\n\n\treturn pr, f.baseRefRepo, g.Wait()\n}\n\nvar pullURLRE = regexp.MustCompile(`^/([^/]+)/([^/]+)/pull/(\\d+)(.*$)`)\n\n// ParseURL parses a pull request URL and returns the repository, pull request\n// number, and any tailing path components. If there is no error, the returned\n// repo is not nil and will have non-empty hostname.\nfunc ParseURL(prURL string) (ghrepo.Interface, int, string, error) {\n\tif prURL == \"\" {\n\t\treturn nil, 0, \"\", fmt.Errorf(\"invalid URL: %q\", prURL)\n\t}\n\n\tu, err := url.Parse(prURL)\n\tif err != nil {\n\t\treturn nil, 0, \"\", err\n\t}\n\n\tif u.Scheme != \"https\" && u.Scheme != \"http\" {\n\t\treturn nil, 0, \"\", fmt.Errorf(\"invalid scheme: %s\", u.Scheme)\n\t}\n\n\tm := pullURLRE.FindStringSubmatch(u.Path)\n\tif m == nil {\n\t\treturn nil, 0, \"\", fmt.Errorf(\"not a pull request URL: %s\", prURL)\n\t}\n\n\trepo := ghrepo.NewWithHost(m[1], m[2], u.Hostname())\n\tprNumber, _ := strconv.Atoi(m[3])","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/cli/cli/blob/0eeec0b92edbe70199f9768522f831d3534f41ad/pkg/cmd/pr/shared/finder.go#L290-L326","documentation":"Error \"invalid URL: %q\" thrown in cli/cli.","triggerScenarios":"Thrown at pkg/cmd/pr/shared/finder.go:308 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid pull request URL, or use a PR number or branch name instead."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eeec0b92edbe70199f9768522f831d3534f41ad","analyzedAt":"2026-08-15T12:31:05.478Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}