{"record":{"id":"281dfbb2e2668b87","repo":"multica-ai/multica","slug":"nothing-to-update-provide-name-and-or-color","errorCode":null,"errorMessage":"nothing to update — provide --name and/or --color","messagePattern":"nothing to update — provide --name and/or --color","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/cmd/multica/cmd_label.go","lineNumber":224,"sourceCode":"\t\treturn err\n\t}\n\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\n\tlabelRef, err := resolveLabelID(ctx, client, args[0])\n\tif err != nil {\n\t\treturn fmt.Errorf(\"resolve label: %w\", err)\n\t}\n\n\tbody := map[string]any{}\n\tif v, _ := cmd.Flags().GetString(\"name\"); v != \"\" {\n\t\tbody[\"name\"] = v\n\t}\n\tif v, _ := cmd.Flags().GetString(\"color\"); v != \"\" {\n\t\tbody[\"color\"] = v\n\t}\n\tif len(body) == 0 {\n\t\treturn fmt.Errorf(\"nothing to update — provide --name and/or --color\")\n\t}\n\n\tvar result map[string]any\n\tif err := client.PutJSON(ctx, \"/api/labels/\"+labelRef.ID, body, &result); err != nil {\n\t\treturn fmt.Errorf(\"update label: %w\", err)\n\t}\n\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"table\" {\n\t\theaders := []string{\"ID\", \"NAME\", \"COLOR\"}\n\t\trows := [][]string{{\n\t\t\tstrVal(result, \"id\"),\n\t\t\tstrVal(result, \"name\"),\n\t\t\tstrVal(result, \"color\"),\n\t\t}}\n\t\tcli.PrintTable(os.Stdout, headers, rows)\n\t\treturn nil\n\t}","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_label.go#L206-L242","documentation":"Thrown by `multica label update` when neither --name nor --color is provided (both default to empty and the body map stays empty). The CLI refuses to send a no-op PATCH/PUT rather than issuing an empty update request.","triggerScenarios":"Running `multica label update bug` with no further flags, or with both flags set to empty strings.","commonSituations":"Users run update expecting an interactive prompt; scripts conditionally build flags and skip both branches; users try to use update to 'view' a label.","solutions":["Provide at least one field: `multica label update bug --color #22c55e`","Use `multica label get` to inspect a label instead of update","In scripts, assert at least one of NAME/COLOR is set before invoking update"],"exampleFix":"# before\nmultica label update bug\n# after\nmultica label update bug --name defect --color #ef4444","handlingStrategy":"validation","validationCode":"# bash: require at least one update field\n[[ -n \"${NAME:-}\" || -n \"${COLOR:-}\" ]] || { echo \"nothing to update\" >&2; exit 2; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never run bare `label update REF`","Use `label get` to inspect, update only with fields","Scripts should assert at least one field is set"],"tags":["cli","flag-validation","labels"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}