Skip to main content

Error Handling

The SDK wraps every failure in a typed VaultkitError subclass so you can decide how the agent should respond. Catch these errors around your calls to connect() or inside the logic that executes tools.

Error classes

All error classes extend VaultkitError, which exposes message, code, and an optional statusCode.

Pattern example

Logging helpers

Pass a log function to createVaultkitClient to receive structured messages about connection attempts, discovered tools, timeouts, and retries. This makes it easy to correlate application logs with Vaultkit’s telemetry in production.
Pair the SDK logs with the Vaultkit dashboard → Tool Telemetry screen to monitor the full lifecycle of each request.