Helix.ID
Sign In

Error handling · 2 min

v0.3.0 · Updated 12 Oct 2026View as Markdown

Error handling

The errors the SDK throws while verifying, and the HTTP response each one deserves.

Error classes

For callback/signature verification errors, the HTTP column suggests a response from your callback handler. For ReferenceListError, upstream means the API's HTTP status exposed as .status; your server decides what to return to its own caller.

Error ClassThrown byHTTPCause
InvalidSignatureErrorverifyCallback401Callback HMAC does not match — possible tampering or wrong secret.
NonceMismatchErrorverifyCallback401Nonce in callback does not match the session nonce.
ExpiredTimestampErrorverifyCallback401Callback timestamp is outside the accepted time window.
MalformedCallbackErrorverifyCallback400Required callback fields are missing or unparseable.
InvalidAuthUrlSignatureErrorverifyAuthUrlSignature401Auth URL sig is missing or does not match — the URL was rewritten.
ReferenceListErroraddToReferenceList / removeFromReferenceListupstreamAPI request returned a non-2xx status. Inspect .status and .code; see endpoint HTTP statuses.

Error codes

Every class extends VoiceAuthError and carries .code. Verification codes are INVALID_SIGNATURE, NONCE_MISMATCH, EXPIRED_TIMESTAMP, MALFORMED_CALLBACK, and INVALID_AUTH_URL_SIGNATURE. ReferenceListError.code preserves the API's error code, with REFERENCE_LIST_REQUEST_FAILED as the fallback when the error body has no usable code. Transport failures and successful-response JSON parsing failures are native errors.