wtfutil/wtf · error

could not create client: %w

Error message

could not create client: %w

What it means

Raised in NewWidget when azrBuild.NewClient fails to construct the Azure DevOps build API client from the PAT connection (orgURL + apiToken). The error is stored in the widget's display buffer rather than returned; the widget will show this message instead of build data. Typically means the client could not be initialized against the organization endpoint.

Source

Thrown at modules/azuredevops/widget.go:33

	cli           azrBuild.Client
	settings      *Settings
	displayBuffer string
	ctx           context.Context
}

func NewWidget(tviewApp *tview.Application, redrawChan chan bool, pages *tview.Pages, settings *Settings) *Widget {
	widget := Widget{
		TextWidget: view.NewTextWidget(tviewApp, redrawChan, pages, settings.Common),
		settings:   settings,
	}

	widget.View.SetScrollable(true)
	connection := azr.NewPatConnection(settings.orgURL, settings.apiToken)
	ctx := context.Background()

	cli, err := azrBuild.NewClient(ctx, connection)
	if err != nil {
		widget.displayBuffer = fmt.Errorf("could not create client: %w", err).Error()
	} else {
		widget.cli = cli
		widget.ctx = ctx
	}

	widget.refreshDisplayBuffer()

	return &widget
}

func (widget *Widget) Refresh() {
	widget.refreshDisplayBuffer()
	widget.Redraw(widget.display)
}

func (widget *Widget) display() (string, string, bool) {
	return widget.CommonSettings().Title, widget.displayBuffer, true
}

View on GitHub (pinned to bb838c1ccb)

Solutions

  1. Verify orgURL is a correct Azure DevOps organization URL (e.g. https://dev.azure.com/myorg)
  2. Verify apiToken is a non-empty valid personal access token
  3. Check network/DNS connectivity to the Azure DevOps endpoint
  4. Review the wrapped error in the display buffer for the client-creation failure cause
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at modules/azuredevops/widget.go:33 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of wtfutil/wtf@bb838c1ccb (2026-09-03). Data as JSON: /api/errors/0f833b8a6ea387df. Report an issue: GitHub.