{"record":{"id":"652f30dce3361206","repo":"BoundaryML/baml","slug":"0-652f30","errorCode":null,"errorMessage":"{0}","messagePattern":"\\{0\\}","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"baml_language/crates/bex_project/src/lib.rs","lineNumber":88,"sourceCode":"            required: m.into_iter().collect(),\n            optional: IndexMap::new(),\n        }\n    }\n}\n\nimpl From<IndexMap<String, BexExternalValue>> for BexArgs {\n    fn from(required: IndexMap<String, BexExternalValue>) -> Self {\n        Self {\n            required,\n            optional: IndexMap::new(),\n        }\n    }\n}\n\n/// Errors that can occur during runtime operations.\n#[derive(Debug, Error)]\npub enum RuntimeError {\n    #[error(\"{0}\")]\n    Other(String),\n\n    #[error(\"Invalid argument: {name}\")]\n    InvalidArgument { name: String },\n\n    #[error(\"{message}\")]\n    Compilation { message: String },\n\n    #[error(\"{0}\")]\n    Engine(#[from] bex_engine::EngineError),\n\n    #[error(\"Failed to convert result to owned value: {0}\")]\n    Access(#[from] bex_heap::AccessError),\n}\n\n/// True iff `err` wraps an engine cancellation panic.\n///\n/// Centralizes the cancellation-classification logic that bridges and the","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/bex_project/src/lib.rs#L70-L106","documentation":"RuntimeError::Other is the catch-all variant of bex_project's runtime error enum: it wraps an arbitrary message string and displays it verbatim via #[error(\"{0}\")]. The library raises it for runtime failures that have no dedicated variant, so the message itself is the only diagnostic.","triggerScenarios":"Any bex_project runtime operation that fails with a condition not covered by InvalidArgument, Compilation, Engine, or Access errors and is reported via RuntimeError::Other(String) — e.g. project-level runtime setup or execution helpers returning an ad-hoc error string.","commonSituations":"Generic runtime failures surfaced through the project facade; glue code mapping miscellaneous failures into RuntimeError::Other; unexpected internal conditions during project run/eval calls.","solutions":["Read the embedded message string — it is the full diagnostic — and fix the condition it describes.","Enable logging/trace output around the bex_project call to capture context for the Other error.","Check whether an underlying error (engine, heap access) is being flattened into Other and handle that root cause directly.","If the message indicates a library bug, reproduce with a minimal snippet and file an issue."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"fn is_other_error(err: &RuntimeError) -> Option<&str> {\n    if let RuntimeError::Other(msg) = err { Some(msg) } else { None }\n}","tryCatchPattern":"match project.run(op) {\n    Ok(v) => v,\n    Err(RuntimeError::Other(msg)) => {\n        log::error!(\"bex_project runtime failure: {msg}\");\n        // act on the message text or surface it to the user\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Enable tracing around bex_project calls to capture context for generic failures","Handle specific RuntimeError variants (Engine, Access) explicitly so only truly miscellaneous cases fall to Other","Keep the library updated; opaque Other errors often hide fixed bugs"],"tags":["rust","runtime","error-handling"],"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-14T11:17:12.474Z"}