{"record":{"id":"86fec18e0c9866f8","repo":"multica-ai/multica","slug":"update-property-w","errorCode":null,"errorMessage":"update property: %w","messagePattern":"update property: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_property.go","lineNumber":384,"sourceCode":"\tif cmd.Flags().Changed(\"description\") {\n\t\tdescription, _ := cmd.Flags().GetString(\"description\")\n\t\tbody[\"description\"] = description\n\t}\n\tif cmd.Flags().Changed(\"icon\") {\n\t\ticon, _ := cmd.Flags().GetString(\"icon\")\n\t\tbody[\"icon\"] = icon\n\t}\n\tif cmd.Flags().Changed(\"option\") {\n\t\toptionFlags, _ := cmd.Flags().GetStringArray(\"option\")\n\t\tbody[\"config\"] = map[string]any{\"options\": parseOptionFlags(optionFlags, property.Config.Options)}\n\t}\n\tif len(body) == 0 {\n\t\treturn fmt.Errorf(\"nothing to update; pass --name, --description, --icon, or --option\")\n\t}\n\n\tvar updated propertyDTO\n\tif err := client.PatchJSON(ctx, \"/api/properties/\"+property.ID, body, &updated); err != nil {\n\t\treturn fmt.Errorf(\"update property: %w\", err)\n\t}\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"json\" {\n\t\treturn cli.PrintJSON(os.Stdout, updated)\n\t}\n\tfmt.Fprintf(os.Stdout, \"Property %q updated.\\n\", updated.Name)\n\tprintPropertyTable([]propertyDTO{updated})\n\treturn nil\n}\n\nfunc makePropertyArchiveRun(archive bool) func(*cobra.Command, []string) error {\n\treturn func(cmd *cobra.Command, args []string) error {\n\t\tclient, err := newAPIClient(cmd)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tctx, cancel := cli.APIContext(context.Background())\n\t\tdefer cancel()","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_property.go#L366-L402","documentation":"Returned by `multica property update` when its PATCH to `/api/properties/<id>` fails. The %w wrap preserves the HTTP client's cause (auth, connectivity, or a 4xx/5xx response such as invalid option config or name conflicts).","triggerScenarios":"PATCHing with an invalid `--icon` value, renaming to a name the server rejects or that collides, sending `--option` flags that produce a config the server refuses (400), expired credentials (401), or server down.","commonSituations":"Renaming a property to an existing name; passing option flags with malformed syntax so `parseOptionFlags` builds a bad config; stale auth token; server restarted mid-script.","solutions":["Inspect the wrapped message for the HTTP status: 401/403 → re-authenticate; 400 → fix the flag payload (name/icon/option syntax).","Confirm the target property ref resolves (`multica property list`) — though ref resolution usually fails earlier with a different message.","Retry after fixing connectivity/token if the wrapped error is a network failure."],"exampleFix":"// before\nmultica property update Priority --option \"bogus=~=x\"\n// error: update property: request failed: 400 ...\n\n// after\nmultica property update Priority --option \"P0\" --option \"P1\" --option \"P2#fff000\"","handlingStrategy":"try-catch","validationCode":"# bash: dry-check the property exists before patching\nmultica property list | grep -qw \"$PROP\" || { echo \"unknown property: $PROP\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":"if err := client.PatchJSON(ctx, path, body, &updated); err != nil {\n    if isAuthError(err) { reauthenticate(); retry once }\n    if isClientError(err) { surface flag problem; do not retry }\n    return fmt.Errorf(\"update property: %w\", err)\n}","preventionTips":["Validate option flag syntax (`name`, `name#color`) before invoking update.","Avoid renames that collide with existing property names.","Refresh tokens in long-lived automation."],"tags":["go","cli","api","network","property"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}