Skip to main content
The SDK reports failures as structured errors with stable codes, so you can map them to player-facing and operator-facing behaviour without string matching.

Native error model

SdkError variants carry an SdkErrorCode:
Codes above map the public contract. See the crate-level error::SdkErrorCode documentation for the authoritative display strings.

Browser error model

@musterbox/sdk-js mirrors codes as structured error objects:

Engine adapters

Unity, Godot, Unreal, Cocos, and Defold translate errors into their idioms (Result<T>/exceptions/boolean + error object) while preserving the code behind message text. See the relevant engine page.

Error handling rules of thumb

  • Never treat transport errors as terminal — retry with the SDK’s backoff (max_retry_attempts = 5).
  • Never fall back to unauthenticated privileged calls after NotAuthenticated.
  • Never retry verify_pin (single-shot) — see Secure purchases.
  • Always capture diagnostics before filing an incident.
Next: CLI.
Last modified on September 10, 2026