WarmHubError
Normalized error shape thrown by the WarmHub SDK.
SDK helpers convert transport, tRPC, validation, and backend failures into
this class so callers can branch on stable code / kind values and read
optional response metadata such as status, hint, and retryAfter.
See ErrorKind for the catalog of stable kinds with cause, retryability, corrective action, and origin per kind, and isRetryable for the canonical retry test.
Example
Section titled “Example”try { await client.repo.get('acme', 'world')} catch (err) { if (isWarmHubError(err) && err.kind === 'NOT_FOUND') { // handle missing repo } else if (isRetryable(err)) { // safe to retry (NETWORK, CANCELLED, BACKEND, RATE_LIMITED) } else { throw err }}Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WarmHubError(
code,message,status?,hint?,retryAfter?,backendCode?,details?):WarmHubError
Parameters
Section titled “Parameters”string
message
Section titled “message”string
status?
Section titled “status?”number
string
retryAfter?
Section titled “retryAfter?”number
backendCode?
Section titled “backendCode?”string
details?
Section titled “details?”Returns
Section titled “Returns”WarmHubError
Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”
readonlycode:string
Stable SDK error code or pass-through backend domain code. Branch on this (or the alias kind) to handle expected failure modes.
status?
Section titled “status?”
readonlyoptionalstatus?:number
HTTP status from the failing response when one was available.
readonlyoptionalhint?:string
Optional human-readable hint surfaced by the backend.
retryAfter?
Section titled “retryAfter?”
readonlyoptionalretryAfter?:number
Seconds the caller should wait before retrying. Present on RATE_LIMITED
responses and other backend signals that carry a Retry-After header.
backendCode?
Section titled “backendCode?”
readonlyoptionalbackendCode?:string
Backend domain code from the response body. Set iff the backend wire
carried a structured error.code string. Use this when the question is
“did the backend specifically say this?”. For best-effort labelling that
also covers SDK-local transport codes (NETWORK, CANCELLED, the
generic BACKEND fallback), branch on code or kind.
details?
Section titled “details?”
readonlyoptionaldetails?:WarmHubErrorDetails
Structured backend error details, when the response carried them. Branch on
details.reason: an expected_version_mismatch carries
expectedVersion/currentVersion so an optimistic-concurrency caller can
re-read HEAD and retry (#3624); a lease_held carries leaseExpiresAt so a
caller can back off until the lease expires (#3625). Present only when the
backend wire carried data.warmhub.details. See WarmHubErrorDetails.
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get kind():
ErrorKind
Returns
Section titled “Returns”Hit a problem or have a question? Get in touch.