{"record":{"id":"0af661467dfd90c1","repo":"BoundaryML/baml","slug":"timeout-message","errorCode":null,"errorMessage":"timeout: {message}","messagePattern":"timeout: (.+?)","errorType":"exception","errorClass":"VmBamlError","httpStatus":null,"severity":"error","filePath":"baml_language/crates/bex_vm_types/src/errors.rs","lineNumber":122,"sourceCode":"        message: String,\n        class_name: Option<String>,\n        language: Option<String>,\n    },\n}\n\n/// An error value from the BAML standard library. Maps 1:1 to a `baml.errors.*` class.\n#[derive(Debug, Error, PartialEq, Clone)]\npub enum VmBamlError {\n    #[error(\"invalid argument: {message}\")]\n    InvalidArgument { message: String },\n\n    #[error(\"parse error: {message}\")]\n    ParseError { message: String },\n\n    #[error(\"I/O error: {message}\")]\n    Io { message: String },\n\n    #[error(\"timeout: {message}\")]\n    Timeout {\n        message: String,\n        duration_ms: Option<i64>,\n    },\n\n    #[error(\"unsupported: {message}\")]\n    Unsupported { message: String },\n\n    #[error(\"access error: {message}\")]\n    AccessError { message: String },\n\n    #[error(\"render prompt: {message}\")]\n    RenderPrompt { message: String },\n\n    #[error(\"LLM client error: {message}\")]\n    LlmClient { message: String },\n\n    /// An error value from the host language that has no direct BAML","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/bex_vm_types/src/errors.rs#L104-L140","documentation":"An error value from the BAML standard library, mapping to the `baml.errors.Timeout` class. It is raised when a bounded operation (e.g. an LLM call, I/O with a deadline) exceeds its allotted time; the optional `duration_ms` records the configured limit that was exceeded.","triggerScenarios":"A stdlib call with an associated timeout/duration parameter runs longer than the configured limit and is aborted; `duration_ms` is populated when a specific limit was configured, `None` when no explicit duration applies.","commonSituations":"Slow LLM endpoints under load; network calls without generous-enough timeouts in CI; setting timeouts too low (e.g. milliseconds vs seconds confusion) when configuring clients.","solutions":["Increase the configured timeout for the operation (fix unit mistakes — ms vs s).","Catch `baml.errors.Timeout` and retry with backoff, possibly with a longer limit.","Check the upstream service's latency/health; timeouts often indicate an outage or rate limiting.","Move long work off the critical path or split it into smaller bounded steps."],"exampleFix":"// before\nlet r = client.call(req, timeout_ms: 500); // too short\n// after\nlet r = client.call(req, timeout_ms: 30000);\n","handlingStrategy":"retry","validationCode":"// BAML: ensure configured timeout is sane before the call\nif timeout_ms <= 0 || timeout_ms > 600000 {\n  return err(\"timeout_ms out of range\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  let r = op(args, timeout_ms);\n} catch e: baml.errors.Timeout {\n  let r = retry_with_backoff(op, args, timeout_ms * 2);\n}","preventionTips":["Set timeouts with correct units and generous margins for LLM calls.","Monitor upstream latency and alert before timeouts become common.","Implement retries with exponential backoff for idempotent operations.","Check service status/health endpoints when timeouts spike."],"tags":["timeout","latency","network","stdlib","baml"],"backgroundTag":"request-timeout","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}