Jguer/yay · error
unhandled operation
Error message
unhandled operation
What it means
Returned by handleCmd when the parsed operation argument does not match any known subcommand case (T/deptest, U/upgrade, B/build, G/getpkgbuild, P/show, Y/yay, W/web). It is the switch's default fall-through: the dispatcher received an operation string it has no handler for, typically because parser.NormalizedOperation yielded an unexpected or empty value.
Solutions
- Check the spelling of the operation letter/word passed on the command line (e.g. -T, -U, -B, -G, -P, -Y, -W)
- Run 'yay --help' to list supported operations
- Verify the arguments parser produced the expected operation for the given flags
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at cmd.go:274 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Jguer/yay@328f4b4939 (2026-09-07).
Data as JSON: /api/errors/2ec144f73c791b1c.
Report an issue: GitHub.
Appendix: source
Thrown at cmd.go:274
case "T", "deptest":
return run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
cmdArgs, run.Cfg.Mode, settings.NoConfirm))
case "U", "upgrade":
return handleUpgrade(ctx, run, cmdArgs)
case "B", "build":
return handleBuild(ctx, run, dbExecutor, cmdArgs)
case "G", "getpkgbuild":
return handleGetpkgbuild(ctx, run, cmdArgs, dbExecutor)
case "P", "show":
return handlePrint(ctx, run, cmdArgs, dbExecutor)
case "Y", "yay":
return handleYay(ctx, run, cmdArgs, run.CmdBuilder,
dbExecutor, run.QueryBuilder)
case "W", "web":
return handleWeb(ctx, run, cmdArgs)
}
return errors.New(gotext.Get("unhandled operation"))
}
// getFilter returns filter function which can keep packages which were only
// explicitly installed or ones installed as dependencies for showing available
// updates or their count.
func getFilter(cmdArgs *parser.Arguments) (upgrade.Filter, error) {
deps, explicit := cmdArgs.ExistsArg("d", "deps"), cmdArgs.ExistsArg("e", "explicit")
switch {
case deps && explicit:
return nil, errors.New(gotext.Get("invalid option: '--deps' and '--explicit' may not be used together"))
case deps:
return func(pkg *upgrade.Upgrade) bool {
return pkg.Reason == alpm.PkgReasonDepend
}, nil
case explicit:
return func(pkg *upgrade.Upgrade) bool {
return pkg.Reason == alpm.PkgReasonExplicitView on GitHub (pinned to 328f4b4939)