strands.sandbox.errors
Error types raised by sandbox execution and file operations.
Mirrors strands-ts/src/sandbox/errors.ts. Each error subclasses its stdlib
equivalent so existing except TimeoutError / except FileNotFoundError
handlers keep working, while giving callers a sandbox-specific type to branch on.
SandboxTimeoutError
Section titled “SandboxTimeoutError”class SandboxTimeoutError(TimeoutError)Defined in: src/strands/sandbox/errors.py:9
Raised by sandbox execution when the configured timeout elapses.
__init__
Section titled “__init__”def __init__(seconds: float | None) -> NoneDefined in: src/strands/sandbox/errors.py:12
Initialize the error with the timeout duration.
Arguments:
seconds- The timeout duration, in seconds, that elapsed.
SandboxPathNotFoundError
Section titled “SandboxPathNotFoundError”class SandboxPathNotFoundError(FileNotFoundError)Defined in: src/strands/sandbox/errors.py:21
Raised by :meth:~strands.sandbox.base.Sandbox.list_files when the path does not exist.
Distinguishes genuine absence (a missing path, or a file where a directory
was expected) from permission or transport failures, which raise plain
:class:OSError/:class:FileNotFoundError.
__init__
Section titled “__init__”def __init__(path: str) -> NoneDefined in: src/strands/sandbox/errors.py:29
Initialize the error with the missing path.
Arguments:
path- The path that does not exist.