multica-ai/multica · error

delete comment: %w

Error message

delete comment: %w

What it means

`multica issue comment delete <comment-id>` issues DELETE /api/comments/{id}. This error wraps any failure: comment not found, already deleted, no permission, or transport/auth errors, with the cause preserved.

Source

Thrown at server/cmd/multica/cmd_issue.go:2037

	output, _ := cmd.Flags().GetString("output")
	if output == "table" {
		return nil
	}
	return cli.PrintJSON(os.Stdout, result)
}

func runIssueCommentDelete(cmd *cobra.Command, args []string) error {
	client, err := newAPIClient(cmd)
	if err != nil {
		return err
	}

	ctx, cancel := cli.APIContext(context.Background())
	defer cancel()

	if err := client.DeleteJSON(ctx, "/api/comments/"+args[0]); err != nil {
		return fmt.Errorf("delete comment: %w", err)
	}

	fmt.Fprintf(os.Stderr, "Comment %s deleted.\n", args[0])
	return nil
}

func runIssueCommentResolve(cmd *cobra.Command, args []string) error {
	return runIssueCommentResolution(cmd, args[0], true)
}

func runIssueCommentUnresolve(cmd *cobra.Command, args []string) error {
	return runIssueCommentResolution(cmd, args[0], false)
}

func runIssueCommentResolution(cmd *cobra.Command, commentID string, resolve bool) error {
	client, err := newAPIClient(cmd)
	if err != nil {
		return err

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Confirm the comment ID via `multica issue comment list <issue>`.
  2. If already deleted, treat as success in idempotent scripts.
  3. Verify permissions and auth for 401/403 responses.
Defensive patterns

Strategy: try-catch

Validate before calling

# bash: confirm the comment exists before deleting
multica issue comment list "$ISSUE" --output json | jq -e --arg c "$CID" 'any(.[]; .id == $c)' >/dev/null \
  || { echo "no such comment: $CID" >&2; exit 2; }

Try / catch

# bash: treat 'not found' as idempotent success in automation
multica issue comment delete "$CID" 2>/tmp/err || {
  grep -q '404\|not found' /tmp/err && exit 0
  cat /tmp/err >&2; exit 1;
}

Prevention

When it happens

Trigger: Passing a wrong or truncated comment ID; deleting a comment that was already removed; lacking delete rights in the workspace; server unreachable.

Common situations: IDs copied without the full prefix; scripts double-running and hitting the second delete; expired token.

Related errors


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/c8925e374a2078c6. Report an issue: GitHub.