docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Error handling

    Handle synchronous and asynchronous exceptions thrown by the Instant Games SDK.

    The Instant Games SDK primarily uses two exception types to represent failed operations:

    • JsException for unexpected errors that occur during execution of JavaScript code. These errors are typically thrown synchronously.
    • APIError for errors related to usage of the SDK. These errors tend to occur asynchronously.
    Topic Description
    Synchronous errors Handle synchronous exceptions thrown by the Instant Games SDK in C# or JavaScript. These include JsException errors that occur in JavaScript.
    Asynchronous errors Handle asynchronous exceptions thrown by the Instant Games SDK. These include errors of type APIError, related to SDK usage.
    Synchronous errors thrown by async methods Handle both JSException and APIError exception types when they're thrown by async methods.

    Additional resources

    • Call asynchronous methods
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)