Appearance
Errors
Every failed answer becomes an NoviqaError:
| Field | Meaning |
|---|---|
code | Stable code for programs, e.g. conflict, forbidden, trade.no_money |
message | Human text; may name the wrong field. Show it, never branch on it |
status | HTTP status |
requestId | Quote it when reporting a problem (also the X-Request-Id header) |
ts
import { NoviqaError } from "@hybrid-solutions-09/noviqa-sdk"
try {
await staff.groups.update(path, { ...changes, version })
} catch (e) {
if (!(e instanceof NoviqaError)) throw e
switch (e.code) {
case "conflict": return reloadAndRetry() // someone saved first
case "forbidden": return toast("You may not change this group")
case "invalid_input": return showFieldError(e.message)
default: return toast(`${e.message} (${e.requestId})`)
}
}Each reference page lists the codes a method can answer under Errors.
Refusals that are not errors
Trades and money operations answer 200 even when execution refuses them: check status in the result.
ts
const r = await staff.accounts.balance(login, { request_id, action: "balance", amount: "-500.00" })
if (r.status === "rejected") toast(r.code) // e.g. trade.no_money