Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Error classes raised by the porter-sandbox TypeScript Sandbox SDK
SandboxError
import { AuthenticationError, NotFoundError, RateLimitError, SandboxError, ServerError, } from "porter-sandbox";
AuthenticationError
NotFoundError
RateLimitError
ServerError
message
string
statusCode
number | null
body
unknown
import { Porter, SandboxError } from "porter-sandbox"; const porter = new Porter(); const sandbox = await porter.sandboxes.create({ image: "python:3.12-slim" }); try { const result = await sandbox.exec(["python", "-c", "raise SystemExit(2)"]); if (result.exit_code !== 0) { console.error(result.stderr); } } catch (error) { if (error instanceof SandboxError) { console.error(`Sandbox API error: ${error.message}`); } else { throw error; } } finally { await sandbox.terminate(); porter.close(); }