en un clic
iii-error-handling
// Handle iii engine and SDK errors across Node, Python, Rust, and browser workers. Use when interpreting error codes, retryability, RBAC denial, timeouts, handler failures, or SDK-specific exception surfaces.
// Handle iii engine and SDK errors across Node, Python, Rust, and browser workers. Use when interpreting error codes, retryability, RBAC denial, timeouts, handler failures, or SDK-specific exception surfaces.
Browser SDK for connecting to the iii engine from web applications via WebSocket. Use when building browser-based clients that register functions, invoke triggers, or consume streams from the frontend.
Binary streaming between workers via channels. Use when building data pipelines, file transfers, streaming responses, or any pattern requiring binary data transfer between functions.
Registers cron triggers with 7-field expressions to run functions on recurring schedules. Use when scheduling periodic jobs, timed automation, crontab replacements, cleanup routines, report generation, batch processing, or calendar-based work that is genuinely time-driven.
Builds custom trigger types for events iii does not handle natively. Use when integrating webhooks, file watchers, IoT devices, database CDC, or any external event source.
Configures the iii engine via iii-config.yaml — workers, adapters, queue configs, ports, and environment variables. Use when deploying, tuning, or customizing the engine.
Registers functions and triggers on the iii engine across TypeScript, Python, and Rust. Use when creating workers, registering function handlers, binding triggers, or invoking functions across languages.
| name | iii-error-handling |
| description | Handle iii engine and SDK errors across Node, Python, Rust, and browser workers. Use when interpreting error codes, retryability, RBAC denial, timeouts, handler failures, or SDK-specific exception surfaces. |
iii has two broad error classes: SDK/local errors and engine/remote invocation errors. Agents should branch on the error code instead of matching only message strings.
Branch on exact code strings, but keep engine wire codes separate from SDK-local codes.
| Code | Emitted by | Meaning | Typical handling |
|---|---|---|---|
function_not_found | Engine and SDK local dispatch | No registered function is available under that ID | Check function ID, worker install/startup, discovery, and trigger type hints |
invocation_error | Engine invocation/router path | Engine failed to route, remember, or complete the invocation | Inspect engine logs, protocol state, and worker connectivity |
invocation_stopped | Engine invocation handler | Invocation was cancelled or stopped by the engine/runtime | Treat as failed work; decide whether caller should retry |
FORBIDDEN | RBAC / worker-gated engine functions | RBAC denied the action | Do not retry blindly; inspect policy, auth context, and allowed functions |
timeout | Engine/worker wire error when a worker reports lowercase timeout | Invocation exceeded a timeout reported through the wire protocol | Treat as timeout, but do not assume every SDK maps it to a timeout subclass |
function_not_invokable | SDK local dispatch | Registration exists but cannot be invoked as a normal local function | Inspect registration/invocation type |
invocation_failed | SDK worker handler wrappers | Local worker handler, HTTP-invoked function wrapper, or SDK-side handler path failed | Inspect handler logs, stacktrace, and payload validation |
TIMEOUT | Node/Python SDK caller timeout | Client waited longer than trigger() timeout | Increase timeout only if the workload is expected to run long; otherwise optimize or enqueue |
timeout, TIMEOUT, transport, or worker reconnect failures only when the operation is idempotent.FORBIDDEN without changing auth/policy.function_not_found by calling the same ID repeatedly; discover functions or install/start the missing worker.TriggerAction.Enqueue({ queue }) and queue retry/DLQ policy.import { IIIInvocationError } from 'iii-sdk'
try {
await iii.trigger({ function_id: 'orders::charge', payload })
} catch (error) {
if (error instanceof IIIInvocationError && error.code === 'FORBIDDEN') {
throw new Error('Policy denied orders::charge')
}
throw error
}
from iii import IIIForbiddenError, IIIInvocationError, IIITimeoutError
try:
result = iii.trigger({"function_id": "orders::charge", "payload": payload})
except IIIForbiddenError:
raise RuntimeError("Policy denied orders::charge")
except IIITimeoutError:
raise RuntimeError("orders::charge timed out")
except IIIInvocationError as exc:
if exc.code == "timeout":
raise RuntimeError("orders::charge timed out")
raise RuntimeError(f"{exc.code}: {exc.message}")
match iii.trigger(request).await {
Ok(value) => value,
Err(iii_sdk::IIIError::Timeout) => {
return Err("orders::charge timed out".into());
}
Err(iii_sdk::IIIError::Remote { code, message, .. }) if code == "FORBIDDEN" => {
return Err(format!("policy denied: {message}").into());
}
Err(err) => return Err(err.into()),
}
Browser trigger calls reject with JavaScript errors. Preserve the engine-provided code/message when present and show policy failures as permission errors in UI.
iii-worker-rbac.iii-trigger-actions.iii-observability.