wtfutil/wtf · error
no mode found
Error message
no mode found
What it means
Exhaustion guard of the mode dispatch switch in Fetch: subMode matched none of the handled prefixes (project_sections, project, workspace). In practice unreachable because Fetch validates mode earlier — it only fires if a new mode string is added to the allowed set without a corresponding switch case.
Source
Thrown at modules/asana/widget.go:135
}
if workspaceId == "" && subMode == "workspace" {
return nil, fmt.Errorf("missing workspace id")
}
var tasks []*TaskItem
var err error
//lint:ignore QF1002 An untagged switch makes sense here.
switch {
case strings.HasPrefix(subMode, "project_sections"):
tasks, err = fetchTasksFromProjectSections(widget.settings.token, projectId, sections, subMode)
case strings.HasPrefix(subMode, "project"):
tasks, err = fetchTasksFromProject(widget.settings.token, projectId, subMode)
case subMode == "workspace":
tasks, err = fetchTasksFromWorkspace(widget.settings.token, workspaceId, subMode)
default:
err = fmt.Errorf("no mode found")
}
if err != nil {
return nil, err
}
return tasks, nil
}
/* -------------------- Unexported Functions -------------------- */
func (widget *Widget) content() (string, string, bool) {
title := widget.CommonSettings().Title
if widget.err != nil {
return title, widget.err.Error(), true
}View on GitHub (pinned to bb838c1ccb)
Solutions
- Ensure the configured mode is one of project, project_sections, workspace
- If a new mode was added to availableModes, add a matching case to the switch statement
- Report a bug if this occurs with a stock configuration, since validation should have rejected the mode earlier
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at modules/asana/widget.go:135 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/3f1bab66e7f6452e.
Report an issue: GitHub.