{"record":{"id":"08c41a94d979bcdd","repo":"BoundaryML/baml","slug":"user-failure-message-please-report-this-error-to-our-team","errorCode":null,"errorMessage":"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.","messagePattern":"User Failure: (.+?)\\.\nPlease report this error to our team with BAML_LOG=info enabled so we can catch this error earlier and improve your development experience\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/types/response.rs","lineNumber":150,"sourceCode":"                                    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                    }\n                    LLMResponse::Cancelled(message) => {\n                        Err(anyhow::anyhow!(crate::errors::ExposedError::AbortError {\n                            detailed_message: message.clone(),\n                        }))\n                    }\n                    LLMResponse::Success(_) => {\n                        Err(anyhow::anyhow!(\"This should never happen - Please report this error to our team with BAML_LOG=info enabled so we can improve this error message\"))\n                    }\n                };\n        };\n\n        result\n    }\n","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/types/response.rs#L132-L168","documentation":"When the chain's LLMResponse is UserFailure, result_with_constraints_content raises an anyhow error noting the failure originated from user code (e.g. an abort() or explicit failure inside a BAML expression). The message asks users to report it with BAML_LOG=info so the failure path can be improved.","triggerScenarios":"BAML function executed a UserFailure — e.g. `fail`/explicit failure semantics in the function body or a user-triggered abort recorded as LLMResponse::UserFailure — and the caller then reads the result.","commonSituations":"Prompts with conditional fail() branches that fired; check/assert logic deliberately failing the run; test harnesses exercising failure paths.","solutions":["Read the embedded message to find why user code declared failure.","Adjust the prompt/logic so the failure branch is not taken, or handle it intentionally.","Reproduce with BAML_LOG=info to capture the full trace and, if unexpected, report to the BAML team."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match chain.content() {\n    Ok(v) => Ok(v),\n    Err(e) if e.to_string().starts_with(\"User Failure:\") => handle_user_failure(e),\n    Err(e) => Err(e),\n}","preventionTips":["Review fail()/abort branches in BAML functions and when they fire","Test prompts against inputs that may trigger explicit failures","Capture BAML_LOG=info traces when failures are unexpected"],"tags":["baml","user-failure"],"backgroundTag":"invalid-state-transition","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"}