{"record":{"id":"0e4fd742495fb054","repo":"go-task/task","slug":"no-continue-values-provided","errorCode":null,"errorMessage":"no continue values provided","messagePattern":"no continue values provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/logger/logger.go","lineNumber":200,"sourceCode":"\t}\n}\n\nfunc (l *Logger) Warnf(message string, args ...any) {\n\tl.Errf(Yellow, message, args...)\n}\n\nfunc (l *Logger) Prompt(color Color, prompt string, defaultValue string, continueValues ...string) error {\n\tif l.AssumeYes {\n\t\tl.Outf(color, \"%s [assuming yes]\\n\", prompt)\n\t\treturn nil\n\t}\n\n\tif !l.AssumeTerm && !term.IsTerminal() {\n\t\treturn ErrNoTerminal\n\t}\n\n\tif len(continueValues) == 0 {\n\t\treturn errors.New(\"no continue values provided\")\n\t}\n\n\tl.Outf(color, \"%s [%s/%s]: \", prompt, strings.ToLower(continueValues[0]), strings.ToUpper(defaultValue))\n\n\treader := bufio.NewReader(l.Stdin)\n\tinput, err := reader.ReadString('\\n')\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinput = strings.TrimSpace(strings.ToLower(input))\n\tif !slices.Contains(continueValues, input) {\n\t\treturn ErrPromptCancelled\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/go-task/task/blob/385e5ad92af02877b6d7cf9dcc963b5ed916e70a/internal/logger/logger.go#L182-L218","documentation":"Raised inside Logger.Prompt when it is invoked with an empty continueValues slice. The prompt renders its accepted answers as '[yes/no]' from continueValues (first entry shown lowercase as the accept key, defaultValue shown uppercase as default), so calling it with no continue values would produce a meaningless/broken prompt and the method fails fast with this error.","triggerScenarios":"Calling Logger.Prompt (or code paths that forward to it) with zero variadic continueValues arguments, e.g. l.Prompt(color, \"Continue?\") or l.Prompt(color, \"Continue?\", \"y\") with no further args — typically from custom executor code or library modifications, not from normal CLI usage.","commonSituations":"Custom tooling built on the task library calling the logger's Prompt API directly; refactors that accidentally drop the variadic arguments; programmatic task execution wrappers. Normal users of the task CLI never see it because built-in prompts always pass values.","solutions":["Pass at least one continue value, e.g. logger.Prompt(color, prompt, \"n\", \"y\", \"yes\")","Check any custom wrapper around Prompt to ensure it forwards the variadic continueValues args","If this comes from a fork/patched build, compare against upstream Prompt call sites to restore missing arguments"],"exampleFix":"// before\nans, err := l.Prompt(logger.Yellow, \"Proceed?\")\n// after\nans, err := l.Prompt(logger.Yellow, \"Proceed?\", \"n\", \"y\", \"yes\")","handlingStrategy":"validation","validationCode":"if len(continueValues) == 0 {\n    return errors.New(\"prompt requires at least one continue value\")\n}\nans, err := l.Prompt(color, prompt, continueValues...)","typeGuard":null,"tryCatchPattern":"if err != nil {\n    if strings.Contains(err.Error(), \"no continue values provided\") {\n        // caller bug: supply default values and retry\n        ans, err = l.Prompt(color, prompt, \"n\", \"y\", \"yes\")\n    }\n    return err\n}","preventionTips":["Always call Prompt with explicit continue values following upstream convention: Prompt(color, prompt, defaultValue, acceptValues...)","Wrap Prompt in a project-local helper that supplies sane defaults instead of calling it ad hoc","Add a unit test for any custom wrapper covering the zero-args case","Mirror upstream call sites (logger.Prompt(logger.Yellow, p, \"n\", \"y\", \"yes\")) when refactoring"],"tags":["go-task","api-misuse","prompt","argument-validation"],"backgroundTag":"empty-required-argument","analyzedSha":"385e5ad92af02877b6d7cf9dcc963b5ed916e70a","analyzedAt":"2026-09-05T09:01:05.226Z","contentChangedAt":"2026-09-05T09:01:05.226Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}