SDKException, wrapping a proto-backed error so the same code
and category cross every language binding.
Codes worth handling
unsupportedCapability
win32-arm64, where only QHexRT loads and anything needing llama.cpp,
ONNX, or Sherpa reports unavailable rather than failing obscurely at first use.
Errors in streams
Preflight failures throw from the call. A failure during generation arrives as afailed
event:
cancelled terminal event, which is not a failure.
This is the same shape as the Web SDK and the opposite of Swift, Kotlin, Flutter, and React
Native, where in-flight failures are thrown into the consumer.
Errors across the context bridge
An exception thrown in the main process does not arrive in the renderer as anSDKException.
Structured clone drops the prototype, so instanceof fails there. Send the code and message
explicitly rather than the error object:
Failures that are not the SDK
The second one is worth remembering, because the error names the model rather than the
packaging fault that caused it.