{"record":{"id":"3f1bab66e7f6452e","repo":"wtfutil/wtf","slug":"no-mode-found","errorCode":null,"errorMessage":"no mode found","messagePattern":"no mode found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/asana/widget.go","lineNumber":135,"sourceCode":"\t}\n\n\tif workspaceId == \"\" && subMode == \"workspace\" {\n\t\treturn nil, fmt.Errorf(\"missing workspace id\")\n\t}\n\n\tvar tasks []*TaskItem\n\tvar err error\n\n\t//lint:ignore QF1002 An untagged switch makes sense here.\n\tswitch {\n\tcase strings.HasPrefix(subMode, \"project_sections\"):\n\t\ttasks, err = fetchTasksFromProjectSections(widget.settings.token, projectId, sections, subMode)\n\tcase strings.HasPrefix(subMode, \"project\"):\n\t\ttasks, err = fetchTasksFromProject(widget.settings.token, projectId, subMode)\n\tcase subMode == \"workspace\":\n\t\ttasks, err = fetchTasksFromWorkspace(widget.settings.token, workspaceId, subMode)\n\tdefault:\n\t\terr = fmt.Errorf(\"no mode found\")\n\t}\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn tasks, nil\n\n}\n\n/* -------------------- Unexported Functions -------------------- */\n\nfunc (widget *Widget) content() (string, string, bool) {\n\n\ttitle := widget.CommonSettings().Title\n\tif widget.err != nil {\n\t\treturn title, widget.err.Error(), true\n\t}","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/wtfutil/wtf/blob/bb838c1ccb0f0f3223690df44afdec663d622881/modules/asana/widget.go#L117-L153","documentation":"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.","triggerScenarios":"Thrown at modules/asana/widget.go:135 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"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"}