{"record":{"id":"c6607b9038cf4824","repo":"BoundaryML/baml","slug":"message-call","errorCode":null,"errorMessage":"{message}","messagePattern":"\\{message\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/internal/llm_client/orchestrator/call.rs","lineNumber":146,"sourceCode":"                        code,\n                        client,\n                        message,\n                        raw_response,\n                        ..\n                    }) => {\n                        match code {\n                            // Timeout error\n                            crate::internal::llm_client::ErrorCode::Timeout => {\n                                Some(Err(anyhow::anyhow!(\n                                    crate::errors::ExposedError::TimeoutError {\n                                        client_name: client.clone(),\n                                        message: message.clone(),\n                                    }\n                                )))\n                            }\n                            // This is some internal BAML error, so handle it like any other error\n                            crate::internal::llm_client::ErrorCode::Other(2) => {\n                                Some(Err(anyhow::anyhow!(message.clone())))\n                            }\n                            _ => Some(Err(anyhow::anyhow!(\n                                crate::errors::ExposedError::ClientHttpError {\n                                    client_name: client.clone(),\n                                    message: message.clone(),\n                                    status_code: code.clone(),\n                                    detailed_message: message.clone(),\n                                    raw_response: raw_response.clone(),\n                                }\n                            ))),\n                        }\n                    }\n                    _ => None,\n                };\n\n                let sleep_duration = node.error_sleep_duration().cloned();\n                let result = (node.scope, response, parsed_response);\n","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/internal/llm_client/orchestrator/call.rs#L128-L164","documentation":"When a provider returns LLMResponse::LLMFailure with ErrorCode::Other(2), BAML treats the message as an internal BAML error and surfaces the raw message string as a plain anyhow error instead of a typed ExposedError. This path exists so internal BAML-level failures (not HTTP failures) propagate their own message unchanged.","triggerScenarios":"Any BAML function call whose orchestrator node receives LLMResponse::LLMFailure with code ErrorCode::Other(2) - internal BAML errors such as client misconfiguration or provider-client construction failures raised during single_call.","commonSituations":"Misconfigured clients.baml (bad provider name, unsupported option), errors building the provider client at request time, or BAML-internal validation failures that are neither timeouts nor HTTP status errors.","solutions":["Read the surfaced message - it is the internal error text - and fix the referenced configuration or input.","Validate clients.baml: provider names, required options (api_key, model), and retry strategy references.","Confirm the api_key env var is set and spelled exactly as referenced in options.","Update the BAML CLI/runtime version; internal error codes can shift between versions.","If it persists, search/track the message against BAML issues on GitHub."],"exampleFix":"// before (clients.baml) - typo'd env var, client fails to build\nclient<Chat> {\n  provider openai\n  options { model gpt-4o api_key env.OPENAI_API_KEY_TYPO }\n}\n// after\nclient<Chat> {\n  provider openai\n  options { model gpt-4o api_key env.OPENAI_API_KEY }\n}","handlingStrategy":"validation","validationCode":"# before calling, validate clients.baml essentials\nimport os\nassert os.environ.get(\"OPENAI_API_KEY\"), \"OPENAI_API_KEY not set\"\n# and ensure client/provider names referenced in functions exist in clients.baml","typeGuard":null,"tryCatchPattern":"// python\ntry:\n    result = b.ExtractDocs(text)\nexcept Exception as e:\n    # internal BAML errors arrive as plain messages; log full text for diagnosis\n    log.error(\"BAML internal error: %s\", e)\n    raise","preventionTips":["Run `baml-cli dev` to catch clients.baml misconfigurations at edit time.","Reference env vars exactly as defined; verify required options per provider docs.","Keep the baml runtime and CLI versions in sync.","Add a startup smoke test that invokes each client with a tiny prompt."],"tags":["internal-error","llm","configuration"],"backgroundTag":"internal-invariant-violation","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}