{"record":{"id":"07d98e9c075ef2d9","repo":"multica-ai/multica","slug":"color-is-required-e-g-3b82f6","errorCode":null,"errorMessage":"--color is required (e.g. #3b82f6)","messagePattern":"--color is required \\(e\\.g\\. #3b82f6\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/cmd/multica/cmd_label.go","lineNumber":173,"sourceCode":"\t\t\tstrVal(label, \"id\"),\n\t\t\tstrVal(label, \"name\"),\n\t\t\tstrVal(label, \"color\"),\n\t\t\tcreated,\n\t\t}}\n\t\tcli.PrintTable(os.Stdout, headers, rows)\n\t\treturn nil\n\t}\n\treturn cli.PrintJSON(os.Stdout, label)\n}\n\nfunc runLabelCreate(cmd *cobra.Command, _ []string) error {\n\tname, _ := cmd.Flags().GetString(\"name\")\n\tcolor, _ := cmd.Flags().GetString(\"color\")\n\tif name == \"\" {\n\t\treturn fmt.Errorf(\"--name is required\")\n\t}\n\tif color == \"\" {\n\t\treturn fmt.Errorf(\"--color is required (e.g. #3b82f6)\")\n\t}\n\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\n\tbody := map[string]any{\"name\": name, \"color\": color}\n\tvar result map[string]any\n\tif err := client.PostJSON(ctx, \"/api/labels\", body, &result); err != nil {\n\t\treturn fmt.Errorf(\"create label: %w\", err)\n\t}\n\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"table\" {\n\t\theaders := []string{\"ID\", \"NAME\", \"COLOR\"}","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_label.go#L155-L191","documentation":"Thrown by `multica label create` when --color is omitted or empty. Color is mandatory for label creation (the example hint #3b82f6 indicates a hex format is expected), enforced client-side before the POST.","triggerScenarios":"Running `multica label create --name bug` without --color, or with an empty color value.","commonSituations":"Users expect a default color to be assigned; scripts that only parameterize the name.","solutions":["Pass a hex color: `multica label create --name bug --color #3b82f6`","Pick colors server-side conventions accept — the error message suggests the #RRGGBB form","Guard scripts to supply a fallback color constant"],"exampleFix":"# before\nmultica label create --name bug\n# after\nmultica label create --name bug --color #ef4444","handlingStrategy":"validation","validationCode":"# bash: require hex color\n[[ \"${COLOR:-}\" =~ ^#[0-9a-fA-F]{6}$ ]] || { echo \"--color must be #RRGGBB\" >&2; exit 2; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a palette of valid hex colors in scripts","Never assume a default color is applied","Pair --name and --color always"],"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"}