SDKException, wrapping a proto-backed error so the same code
and category cross every language binding.
isSDKException is the type guard to use. A bare instanceof can fail across bundle
boundaries when two copies of the package end up in one page.
Codes worth handling
unsupportedCapability
Two cases you will actually meet:Browser-specific failures
Some failures are the browser, not the SDK, and reading them as SDK errors sends you the wrong way:Errors in streams
Preflight throws from the call. A failure during generation arrives as afailed event
rather than an exception:
Cancellation
Breaking out of the loop cancels the request and is not an error.Reporting
catch is how a broken build
looks like a working one.