{"record":{"id":"6cae5cf2afabd572","repo":"BoundaryML/baml","slug":"this-should-never-happen-please-report-this-error-to-our","errorCode":null,"errorMessage":"This should never happen - Please report this error to our team with BAML_LOG=info enabled so we can improve this error message","messagePattern":"This should never happen - Please report this error to our team with BAML_LOG=info enabled so we can improve this error message","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"critical","filePath":"engine/baml-runtime/src/types/response.rs","lineNumber":161,"sourceCode":"                                    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\n    fn format_last_error_with_details(&self, last_error: &anyhow::Error) -> ExposedError {\n        let detailed_message = self.create_detailed_message();\n\n        if let Some(exposed_error) = last_error.downcast_ref::<ExposedError>() {\n            return self.add_detailed_message_to_exposed(exposed_error.clone(), detailed_message);\n        }\n\n        self.add_detailed_message_to_exposed(self.format_single_error(last_error), detailed_message)\n    }\n\n    fn format_single_error(&self, err: &anyhow::Error) -> ExposedError {","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/types/response.rs#L143-L179","documentation":"result_with_constraints_content reaches its final branch when the LLMResponse is Success — meaning a parsed result exists yet the code path expected a failure. This is unreachable by construction and signals a BAML runtime invariant violation; the message asks users to report it with BAML_LOG=info.","triggerScenarios":"result_with_constraints() returned None (no parsed result slot) while llm_response() is LLMResponse::Success — an internally inconsistent ResponseChain state.","commonSituations":"BAML runtime bugs where the success result was not stored into the chain; partially-constructed or deserialized response chains; version mismatch between runtime and bindings.","solutions":["Update the BAML runtime and generated clients to matching, current versions.","Re-run with BAML_LOG=info and file a bug report with the trace, as instructed by the message.","Catch the error at the boundary and retry, since the state is transient to that chain instance."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"match chain.content() {\n    Ok(v) => Ok(v),\n    Err(e) if e.to_string().contains(\"This should never happen\") => {\n        report_bug_with_baml_log(&e);\n        retry_or_default()\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Update BAML runtime and generated bindings together","Avoid constructing/deserializing ResponseChain objects manually","Report occurrences to the BAML team with BAML_LOG=info traces"],"tags":["internal","bug","unreachable"],"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"}