TryGhost/Ghost · warning · Error

Failed to report comment

Error message

Failed to report comment

What it means

comments.report() POSTs to /members/api/comments/{comment.id}/report to flag a comment for moderator review. Returns 'Success' on ok, throws on non-ok, no body sent. This is a member-initiated moderation action and is typically rate-limited to prevent abuse.

Source

Thrown at apps/comments-ui/src/utils/api.ts:354

                        return 'Success';
                    } else {
                        throw new Error('Failed to undislike comment');
                    }
                });
            },
            report({comment}: {comment: {id: string}}) {
                const url = endpointFor({type: 'members', resource: `comments/${comment.id}/report`});
                return makeRequest({
                    url,
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    }
                }).then(function (res) {
                    if (res.ok) {
                        return 'Success';
                    } else {
                        throw new Error('Failed to report comment');
                    }
                });
            }
        },
        init: (() => {}) as () => Promise<{ member: any; labs: any; supportEmail: string | null}>
    };

    api.init = async () => {
        const [member] = await Promise.all([
            api.member.sessionData()
        ]);

        let labs = {};
        let supportEmail: string | null = null;

        try {
            const settings = await api.site.settings();
            if (settings.settings.labs) {

View on GitHub (pinned to 47d8b0e2ad)

Solutions

  1. Check the Network tab POST response status and body.
  2. If 409 (already reported), show 'You have already reported this comment' and disable the button.
  3. If 429, inform the user to wait before reporting again; implement client-side cooldown.
  4. If 401, re-authenticate; if 404, remove the comment locally.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await api.comments.report({comment});
  // show 'reported' confirmation
} catch (e) {
  if (e instanceof Error && e.message === 'Failed to report comment') {
    // 409 already reported, 429 rate limited, 401 auth — branch on status if exposed
  }
}

Prevention

When it happens

Trigger: The POST returns 4xx/5xx. The member is unauthenticated (401), the comment was already reported by this member (409), the comment was deleted (404), the member is banned (403), or rate limiting applies due to repeated reports (429).

Common situations: A member reports a comment twice (second report rejected as duplicate). Session expiry. The comment was removed by a moderator before the report request landed. Abuse-prevention rate limiting after multiple reports.

Related errors


AI-assisted analysis of TryGhost/Ghost@47d8b0e2ad (2026-08-13). Data as JSON: /api/errors/63ca5ee56ef35ee1. Report an issue: GitHub.