Error with a stable message from a local check that runs before any request.
GolApiError and GolTransportError are exported from both entry points. GolWebhookVerificationError is exported from @gol/sdk/server only, because verification itself is server-only.
GolApiError
code, not on status or message. The code set is stable across versions; a status can change with the shape of a request and a message is written for people. Understand API errors lists every code and what to check.
correlationId is also returned in the x-correlation-id response header, and the client prefers the one in the body. Log it with the operation you attempted, never with the API key or the full Authorization header.
GolTransportError
GolTransportError means the SDK never got a usable answer. It has no code and no status, because there is no response to attribute it to. The original failure is on cause when there was one.
baseUrlis not an absolute URL, uses plain HTTP on a non-local host, or carries credentials, a query string, or a fragment.- The API key does not match
gol_test_...orgol_live_.... - A
GolManagementClientmethod that needs a session was called with nosessionToken. prepareGasExecutionorsubmitGasExecutionreceived anactionIdthat is not 32 bytes of hex.- The API answered
204for a route that returns a body, or answered with something that is not JSON. - A polling helper passed its
timeoutMs.
Retrying a value-moving request
A transport failure is ambiguous: your request may have been fully processed while the answer was lost. That is only safe because the action ID is the idempotency key.Local checks throw plain Error
The owner helpers and encoders validate their input before any network call or wallet prompt. These are plain Error objects whose message is a stable identifier, not a class, so match on the message.
A throw means the SDK or the API would not proceed. None of them means the owner’s account is unsafe, and none should be resolved by retrying with altered inputs. Owner signing covers the ones you will meet most.
Webhook verification failures
verifyWebhook throws GolWebhookVerificationError for exactly four reasons, and all four should be answered with a non-2xx status so GOL retries.
Log without leaking
Keep the operation, the project ID, the action or policy ID, the status, the code, and the correlation ID. Leave out the API key, the developer session token, the webhook secret, and the fullAuthorization header. A correlation ID with no credential beside it is enough for GOL to find the request.