LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Configuration
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsConfigurationTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsindexSandboxError
Class●Since v1.7

SandboxError

Custom error class for sandbox operations.

Copy
class SandboxError

Bases

Error

Example

Copy
try {
  await sandbox.execute("some command");
} catch (error) {
  if (error instanceof SandboxError) {
    switch (error.code) {
      case "NOT_INITIALIZED":
        await sandbox.initialize();
        break;
      case "COMMAND_TIMEOUT":
        console.error("Command took too long");
        break;
      default:
        throw error;
    }
  }
}

Constructors

constructor
constructor

Properties

property
[SANDBOX_ERROR_SYMBOL]: true

Symbol for identifying sandbox error instances

property
cause: Error
property
code: string

Structured error code for programmatic handling

property
message: string
property
name: string

Error name for instanceof checks and logging

property
stack: string
property
stackTraceLimit: number

Methods

method
captureStackTrace
method
isInstance→ error is SandboxError
method
prepareStackTrace
View source on GitHub