{"record":{"id":"f502143c1f943870","repo":"wtfutil/wtf","slug":"could-not-get-builds-w","errorCode":null,"errorMessage":"could not get builds: %w","messagePattern":"could not get builds: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/azuredevops/client.go","lineNumber":16,"sourceCode":"package azuredevops\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\tazrBuild \"github.com/microsoft/azure-devops-go-api/azuredevops/build\"\n)\n\nfunc (widget *Widget) getBuildStats() string {\n\tprojName := widget.settings.projectName\n\tstatusFilter := azrBuild.BuildStatusValues.All\n\ttop := widget.settings.maxRows\n\tbuilds, err := widget.cli.GetBuilds(widget.ctx, azrBuild.GetBuildsArgs{Project: &projName, StatusFilter: &statusFilter, Top: &top})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not get builds: %w\", err).Error()\n\t}\n\n\tresult := \"\"\n\tfor _, build := range builds.Value {\n\t\tnum := *build.BuildNumber\n\t\tbranch := *build.SourceBranch\n\t\treason := *build.Reason\n\t\ttriggers := *build.TriggerInfo\n\t\tif reason == azrBuild.BuildReasonValues.PullRequest {\n\t\t\tbranch = triggers[\"pr.sourceBranch\"]\n\t\t}\n\t\tbranch = strings.TrimPrefix(branch, \"refs/heads/\")\n\t\tstatus := *build.Status\n\t\tstatusDisplay := \"[white:grey]unknown\"\n\n\t\tswitch status {\n\t\tcase azrBuild.BuildStatusValues.InProgress:\n\t\t\tstatusDisplay = \"[white:blue]in progress\"","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/wtfutil/wtf/blob/bb838c1ccb0f0f3223690df44afdec663d622881/modules/azuredevops/client.go#L1-L34","documentation":"Wraps an error from the Azure DevOps Build API GetBuilds call in getBuildStats: the widget could not retrieve the build list for the configured project. Fires on network failures, invalid PAT token, wrong organization/project name, or API errors.","triggerScenarios":"Thrown at modules/azuredevops/client.go:16 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the PAT token (apiToken setting) is valid and has Build read scope","Check orgURL and projectName settings match the actual Azure DevOps organization/project","Confirm network access to dev.azure.com including proxy/firewall rules","Read the wrapped error (%w) for the specific HTTP or authentication failure"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bb838c1ccb0f0f3223690df44afdec663d622881","analyzedAt":"2026-09-03T17:02:45.030Z","contentChangedAt":"2026-09-03T17:02:45.030Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}