{"record":{"id":"c8b5a2dbd65adb54","repo":"wtfutil/wtf","slug":"currentcmd-execution-failed-w","errorCode":null,"errorMessage":"currentCmd execution failed: %w","messagePattern":"currentCmd execution failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/progress/widget.go","lineNumber":84,"sourceCode":"\t\t\twidget.err = fmt.Errorf(\"minimumCmd execution failed: %w\", err)\n\t\t\twidget.display()\n\t\t\treturn\n\t\t}\n\t}\n\n\tif cmd := widget.settings.maximumCmd; cmd != \"\" {\n\t\twidget.maximum, err = widget.execValueCmd(cmd)\n\t\tif err != nil {\n\t\t\twidget.err = fmt.Errorf(\"maximumCmd execution failed: %w\", err)\n\t\t\twidget.display()\n\t\t\treturn\n\t\t}\n\t}\n\n\tif cmd := widget.settings.currentCmd; cmd != \"\" {\n\t\twidget.current, err = widget.execValueCmd(cmd)\n\t\tif err != nil {\n\t\t\twidget.err = fmt.Errorf(\"currentCmd execution failed: %w\", err)\n\t\t\twidget.display()\n\t\t\treturn\n\t\t}\n\t}\n\n\twidget.calcPercent()\n\n\twidget.display()\n}\n\n/* -------------------- Unexported Functions -------------------- */\n\nfunc (widget *Widget) content() string {\n\tif widget.err != nil {\n\t\treturn \"[red]Error: \" + widget.err.Error()\n\t}\n\n\tpercent := widget.formatPercent(widget.percent)","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/wtfutil/wtf/blob/bb838c1ccb0f0f3223690df44afdec663d622881/modules/progress/widget.go#L66-L102","documentation":"Raised in the progress widget's Refresh when the configured currentCmd shell command fails (non-zero exit, command not found, or no output) — the widget cannot determine the current value, stores the error, and displays it instead of the progress bar.","triggerScenarios":"Thrown at modules/progress/widget.go:84 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run currentCmd manually in the configured shell to reproduce the failure","Check the command exists on PATH or use an absolute path","Ensure the command prints a numeric value to stdout and exits 0","Verify the SHELL environment variable is set"],"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"}