Skip to content

Type Alias: ApiErrorBody

type ApiErrorBody = object;

Defined in: packages/sdk/src/index.ts:466

JSON body the API returns on every non-2xx response; surfaced as NlqdbApiError.body. code / message / action / retryable are rendered server-side from the @nlqdb/errors registry (SK-ERR-001) so a surface renders them verbatim instead of keeping its own copy table; params carries the code’s declared, secret-free cause fields.

Property Type Description Defined in
action? string The single next action the reader can take (GLOBAL-012). packages/sdk/src/index.ts:471
candidate_dbs? CandidateDb[] - packages/sdk/src/index.ts:479
clarification? | "create_or_query_pinned" | "destructive_ambiguous" | "missing_required_reference" | "low_confidence" SK-ASK-014 / SK-ASK-026 / SK-ASK-031 / GLOBAL-040 — present on clarify_required envelopes. create_or_query_pinned carries pinned_db; destructive_ambiguous (the “clear db” family), missing_required_reference, and low_confidence (a below-floor plan, GLOBAL-040) each carry options + a one-sentence reason. packages/sdk/src/index.ts:485
code ApiErrorCode - packages/sdk/src/index.ts:467
count? number - packages/sdk/src/index.ts:478
limit? number - packages/sdk/src/index.ts:477
link? string SK-PREMIUM-013 — a deep link to the page that resolves the error, when one exists (e.g. the add-your-key page on a BYOLLM misconfiguration). Non-interactive surfaces render it verbatim so a user isn’t stranded on an error with no next click (GLOBAL-012, “one sentence + next action”). packages/sdk/src/index.ts:497
message? string One sentence naming what happened (GLOBAL-012). Render verbatim. packages/sdk/src/index.ts:469
model? string SK-LLM-051 — the upstream model id the failed lane attempted, present on llm_failed envelopes when a model was pinned (never a key). Surfaces name it so a failure attributes to a model (SK-PREMIUM-004), not a black box. packages/sdk/src/index.ts:506
options? ClarifyOption[] SK-ASK-026 — present on a destructive_ambiguous clarify. packages/sdk/src/index.ts:492
params? Record<string, unknown> Declared cause fields for this code (bounded enums / slugs only). packages/sdk/src/index.ts:475
pinned_db? PinnedDb | null - packages/sdk/src/index.ts:490
reason? string - packages/sdk/src/index.ts:476
referencedTables? string[] SK-ASK-016 — present on schema_mismatch envelopes; non-empty only on the pre-flight hallucination path (the LLM’s hallucinated tables), empty on the exec-catch missing-relation / orphaned-schema path (SK-ASK-019). packages/sdk/src/index.ts:501
retryable? boolean Derived from the code’s recoverability — never guess your own. packages/sdk/src/index.ts:473
schemaTables? string[] - packages/sdk/src/index.ts:502