{"record":{"id":"21080ccb24e7931d","repo":"wtfutil/wtf","slug":"missing-mode-or-mode-is-invalid-please-set-to-p","errorCode":null,"errorMessage":"missing mode, or mode is invalid - please set to project, project_sections or workspace","messagePattern":"missing mode, or mode is invalid - please set to project, project_sections or workspace","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/asana/widget.go","lineNumber":97,"sourceCode":"\t}\n\n\twidget.Render()\n}\n\nfunc (widget *Widget) Render() {\n\twidget.Redraw(widget.content)\n}\n\nfunc (widget *Widget) Fetch(workspaceId, projectId, mode string, sections []string, allUsers bool) ([]*TaskItem, error) {\n\n\tavailableModes := map[string]interface{}{\n\t\t\"project\":          nil,\n\t\t\"project_sections\": nil,\n\t\t\"workspace\":        nil,\n\t}\n\n\tif _, ok := availableModes[mode]; !ok {\n\t\treturn nil, fmt.Errorf(\"missing mode, or mode is invalid - please set to project, project_sections or workspace\")\n\t}\n\n\tif widget.settings.apiKey != \"\" {\n\t\twidget.settings.token = widget.settings.apiKey\n\t} else {\n\t\twidget.settings.token = os.Getenv(\"WTF_ASANA_TOKEN\")\n\t}\n\n\tif widget.settings.token == \"\" {\n\t\treturn nil, fmt.Errorf(\"missing environment variable token or apikey config\")\n\t}\n\n\tsubMode := mode\n\tif allUsers && mode != \"workspace\" {\n\t\tsubMode += \"_all\"\n\t}\n\n\tif projectId == \"\" && strings.HasPrefix(subMode, \"project\") {","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/wtfutil/wtf/blob/bb838c1ccb0f0f3223690df44afdec663d622881/modules/asana/widget.go#L79-L115","documentation":"Input validation guard in Fetch: the mode argument was empty or not one of the accepted values (project, project_sections, workspace), so the widget cannot determine which fetch strategy to use and aborts before any API call.","triggerScenarios":"Thrown at modules/asana/widget.go:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the mode option in the Asana widget config to one of: project, project_sections, workspace","Check for typos or extra whitespace in the configured mode value","Ensure the config key is actually present — an unset mode yields an empty string, which fails this check"],"exampleFix":null,"handlingStrategy":"validation","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"}