Core

Errors ​

When the data API refuses a request, or a request can't complete, core throws a CommentsRequestError. Its message is always safe to show a visitor, in the site's language where the server wrote it, and the rest says what went wrong in a form your code can act on. The thread store throws these from its actions, keeps one in state.error when a thread couldn't load, and puts its details in the comments:request-error event.

js
import { isCommentsRequestError } from '@verbb/comments-core';

try {
    await store.vote(commentUid, 'upvote');
} catch (error) {
    if (!isCommentsRequestError(error)) throw error;

    if (error.code === 'rate_limited') {
        showNotice(`Too many votes. Try again in ${error.retryAfter ?? 60} seconds.`);
    } else if (error.category === 'auth') {
        showSignInPrompt();
    } else {
        showNotice(error.message);
    }
}

What an Error Holds ​

PropertyWhat it is
messageA sentence for the visitor.
codeThe first error's code, from the table below.
categoryA broad group, such as validation or auth.
statusThe HTTP status, or 0 when there was no response.
errorsEvery error the server gave, each with its own code, category, message, fieldErrors, recoverable and retryAfter.
fieldErrorsEvery error's field messages merged, keyed by field as content, guest.name, guest.email or fields.handle, ready for a form.
recoverableWhether trying again, after a refresh or a wait, can succeed.
retryAfterSeconds to wait before trying again, for rate_limited, or null.
operationIdThe write's ID, so a retry can reuse it, as Client and Transports explains.
detailWhat went wrong for a developer, such as the API versions that didn't match. Never shown to visitors.

error.has(code) checks every error rather than only the first, which matters for a post refused for more than one reason.

Handling Codes by Category ​

New codes may be added in any release, so handle a code you don't recognise by its category. Every code belongs to one.

CategoryWhat it covers
validationSomething posted didn't pass, with fieldErrors saying where. Show the messages beside the fields.
protectionThe spam protection refused the post or couldn't run.
rateToo many requests from one address. Wait retryAfter seconds.
authWho's asking couldn't be established, or isn't allowed from this origin. The sign-in provider recovers from the ones it can by itself.
policyThe person isn't allowed to do this, such as in a closed thread.
stateWhat was asked about doesn't exist, or changed in the meantime.
requestThe request itself was wrong, usually a mistake in code rather than anything a visitor did.
serverThe server failed or answered with something other than the data API's JSON.
networkThe request never reached the server, or took too long.

Every Code ​

The HTTP status is the one the server answers with. Codes without one are raised by core itself, when a request never reached the server or the answer wasn't the data API's JSON. COMMENTS_ERROR_CODES holds the same list, with each code's category and status.

CodeCategoryHTTP statusWhen it happens
validation_failedvalidation422Something posted didn’t pass validation, such as an empty comment or a required field left out. fieldErrors says which.
file_type_not_allowedvalidation422An upload’s type isn’t allowed, or its contents don’t match its extension.
file_too_largevalidation422An upload is larger than the field or the server allows.
too_many_filesvalidation422More files than a field takes, or a guest’s address has too many uploads waiting to be posted.
protection_requiredprotection422A write arrived without the spam protection evidence it needs, or with a preparation that isn’t valid.
protection_expiredprotection422The protection preparation ran out or was already used. Core fetches a new one and tries once more by itself.
protection_unavailableprotection503The spam protection service couldn’t be reached. Trying again later can work.
challenge_failedprotection422The visitor didn’t pass a challenge, such as Turnstile’s. Never retried automatically.
possible_spamprotection422Protect judged the comment to be spam. Never retried automatically.
rate_limitedrate429Too many requests from one address. retryAfter says how many seconds to wait.
sign_in_requiredauth401The action needs a signed-in member, or a request on another site came without a member token.
token_expiredauth401A member token ran out. memberToken() fetches the next one and tries once more.
token_revokedauth401A member token was revoked or isn’t known, or its member changed their password since it was minted.
session_expiredauth401A guest’s session token ran out, changed or moved. The sign-in provider starts a new session and tries once more.
origin_not_allowedauth403The request’s origin doesn’t fit its profile, or isn’t listed in Other Sites with what it needs.
csrf_failedauth403A cookie sign-in’s write came without a valid CSRF token. cookieSession() reads a new token and tries once more.
signature_invalidauth401A signed member-token or revoke-member-tokens request from a site’s own server has a missing, wrong, old or repeated signature.
user_not_eligibleauth403A member-token request named a user who can’t have one, such as a suspended or unknown user.
forbiddenpolicy403The person can’t do this to this comment, such as voting where voting is off or editing someone else’s comment.
blockedpolicy403The person is blocked from taking part.
closedpolicy403The thread is closed to new comments.
edit_window_passedpolicy403The comment can no longer be edited or deleted by its author.
not_foundstate404The owner, comment or thread doesn’t exist or isn’t public, or has comments turned off.
conflictstate409The comment changed since it was loaded. Load it again before saving.
limit_exceededrequest400A request asked for too many items at once.
invalid_cursorrequest400A page’s cursor isn’t valid any more, such as after the sort or limit changed. Load the thread again.
method_not_allowedrequest405The action was called with the wrong HTTP method.
unsupported_api_versionrequest400The server and the package read different versions of the JSON format, usually a page left open across an upgrade. Reloading fixes it.
server_errorserver500The server failed, or answered with an error page rather than the data API’s JSON.
network_errornetworkNone, raised by coreThe request never reached the server, or was abandoned after the timeout.
invalid_responseserverNone, raised by coreThe answer wasn’t the data API’s JSON, such as a proxy’s page or a body without apiVersion.
invalid_requestrequest400The request couldn’t be read, such as a body that isn’t a JSON object or a profile the API doesn’t know.

The plugin's Data API reference shows the error response these come from.

Last updated: Nov 18, 2026, 12:27 PM