throwIfError static method
Throw an SDKException if code indicates failure (non-zero). Mirrors
Swift's SDKException.throwIfError(_:).
Implementation
static void throwIfError(int code) {
final ex = fromResult(code);
if (ex != null) throw ex;
}