{"record":{"id":"a99d52e31003074c","repo":"BoundaryML/baml","slug":"failed-to-get-selected-call-w","errorCode":null,"errorMessage":"failed to get selected call: %w","messagePattern":"failed to get selected call: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/language_client_go/pkg/rawobjects_function_log.go","lineNumber":144,"sourceCode":"\tresult, err := raw_objects.CallMethod(f, \"calls\", nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get calls: %w\", err)\n\t}\n\n\tresult_cast := result.([]raw_objects.RawPointer)\n\tcalls := make([]LLMCall, len(result_cast))\n\n\tfor i, call := range result_cast {\n\t\tcalls[i] = call.(LLMCall)\n\t}\n\n\treturn calls, nil\n}\n\nfunc (f *functionLog) SelectedCall() (LLMCall, error) {\n\tresult, err := raw_objects.CallMethod(f, \"selected_call\", nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get selected call: %w\", err)\n\t}\n\n\tcall, ok := result.(LLMCall)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unexpected type for selected call: %T\", result)\n\t}\n\n\treturn call, nil\n}\n\nfunc (f *functionLog) Tags() (map[string]any, error) {\n\tresult, err := raw_objects.CallMethod(f, \"tags\", nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get tags: %w\", err)\n\t}\n\n\ttags, ok := result.(map[string]any)\n\tif !ok {","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/language_client_go/pkg/rawobjects_function_log.go#L126-L162","documentation":"SelectedCall() fetches the currently selected LLM call via the 'selected_call' bridge method. This error wraps any failure of the bridge call itself (transport error, missing method, runtime exception), distinct from the type-assertion failure thrown right after.","triggerScenarios":"Calling FunctionLog.SelectedCall() when the bridge call fails: the runtime object is invalid, the 'selected_call' method is absent, or the runtime raises while resolving the selected call.","commonSituations":"Querying selected call before the function produced/selected any call and the runtime errors instead of returning nil; runtime/runtime-binding version drift; stale disposed object handle.","solutions":["Read the wrapped root cause from the error chain","Verify 'selected_call' exists in the connected runtime version","Ensure the function has produced a call selection before querying"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if flog == nil { return nil, errors.New(\"nil function log\") }","typeGuard":null,"tryCatchPattern":"call, err := flog.SelectedCall()\nif err != nil {\n    return nil, fmt.Errorf(\"no selected call available: %w\", err)\n}","preventionTips":["Only query SelectedCall after the function has produced calls","Check runtime version compatibility for the 'selected_call' method","Treat 'no selection yet' as an expected state in your flow"],"tags":["go","rpc","error-wrapping","llm"],"backgroundTag":"type-mismatch","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}