{"record":{"id":"8ccbc2742222cf08","repo":"BoundaryML/baml","slug":"err-message-llm-failure-code-other-2","errorCode":null,"errorMessage":"{err.message} (LLM failure code Other(2))","messagePattern":"(.+?) \\(LLM failure code Other\\(2\\)\\)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/types/response.rs","lineNumber":136,"sourceCode":"            .as_ref()\n            .map(|res| match res {\n                Ok(val) => Ok(val),\n                Err(err) => Err(anyhow::anyhow!(self.format_last_error_with_details(err))),\n            })\n        else {\n            // If we don't have a parsed result, check if we have an LLMFailure\n            return match self.llm_response() {\n                    LLMResponse::LLMFailure(err) => {\n                        // Convert LLMFailure to appropriate error type\n                        match &err.code {\n                            crate::internal::llm_client::ErrorCode::Timeout => {\n                                Err(anyhow::anyhow!(crate::errors::ExposedError::TimeoutError {\n                                    client_name: err.client.clone(),\n                                    message: err.message.clone(),\n                                }))\n                            }\n                            crate::internal::llm_client::ErrorCode::Other(2) => {\n                                Err(anyhow::anyhow!(err.message.clone()))\n                            }\n                            _ => Err(anyhow::anyhow!(\n                                crate::errors::ExposedError::ClientHttpError {\n                                    client_name: err.client.clone(),\n                                    message: err.message.clone(),\n                                    status_code: err.code.clone(),\n                                    detailed_message: err.message.clone(),\n                                    raw_response: err.raw_response.clone(),\n                                }\n                            )),\n                        }\n                    }\n                    LLMResponse::UserFailure(message) => {\n                        Err(anyhow::anyhow!(\"User Failure: {message}.\\nPlease report this error to our team with BAML_LOG=info enabled so we can catch this error earlier and improve your development experience.\"))\n                    }\n                    LLMResponse::InternalFailure(message) => {\n                        Err(anyhow::anyhow!(\"Internal Failure: {message}.\\nThis should not happen - please report this error to our team with BAML_LOG=info enabled so we can catch this error earlier and improve your development experience.\"))\n                    }","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/types/response.rs#L118-L154","documentation":"For an LLMFailure with ErrorCode::Other(2), result_with_constraints_content surfaces the raw failure message directly via anyhow, without wrapping it in an ExposedError variant. Other(2) is a sentinel code BAML uses for provider-specific/uncategorized failures whose message is already user-facing.","triggerScenarios":"Reading the result of a chain whose LLM call failed with ErrorCode::Other(2) — provider-side errors that BAML maps to this sentinel (e.g. content-filter or provider-reported failures).","commonSituations":"Provider content-policy refusals, provider 4xx responses BAML maps to Other(2), malformed provider responses that surface as a plain message.","solutions":["Read the surfaced message — it reflects the provider's own error text; address what it says (e.g. adjust prompt to pass content filters).","Enable BAML_LOG=debug to see the full raw request/response for the failing call.","Add retry/fallback logic for transient provider failures."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match chain.content() {\n    Ok(v) => Ok(v),\n    Err(e) => { log::warn!(\"provider failure: {e}\"); fallback_client_call() }\n}","preventionTips":["Run with BAML_LOG=debug in development to see raw provider responses","Adjust prompts to avoid content-filter refusals","Add fallback clients for provider-specific failures"],"tags":["llm","provider-error"],"backgroundTag":"upstream-api-error","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"}