NylorunDocsBeta
Runtime APIAgents SDK

Errors

The errors the Agents SDK throws and when.

import { RuntimeError } from "@nylorun/agents";

try {
  await session.input(text, { idempotencyKey });
} catch (error) {
  if (error instanceof RuntimeError && error.status === 409) {
    // the same idempotencyKey with different content
  }
  throw error;
}

Client errors

ClassThrown whenFields
RuntimeErrorThe Runtime answers with an error statusstatus, body
IncompatibleRuntimeErrorThe Runtime's protocol is outside the client's range, or lacks a feature the call needscompatibility, remedy, host
ConnectionErrorcreateClient() finds no connectioncode

RuntimeError.body is the Runtime's JSON error. Each endpoint page lists the statuses it answers with; Troubleshooting explains the common codes.

Definition errors

ClassThrown whenFields
AgentBuildErrorAn agent definition is invaliddiagnostics
WorkflowBuildErrorA flow is invaliddiagnostics
McpErrorAn MCP server is invalid, such as a stdio servercode
SkillsErrorA skills folder cannot be loadedcode, diagnostics
PluginErrorA plugin package cannot be loadedcode, diagnostics

On this page