{"record":{"id":"86afcb9bf8db759c","repo":"BoundaryML/baml","slug":"failed-to-get-calls-w","errorCode":null,"errorMessage":"failed to get calls: %w","messagePattern":"failed to get calls: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/language_client_go/pkg/rawobjects_function_log.go","lineNumber":128,"sourceCode":"\nfunc (f *functionLog) CallsCount() (int, error) {\n\tresult, err := raw_objects.CallMethod(f, \"calls_count\", nil)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to get calls count: %w\", err)\n\t}\n\n\tcount, ok := result.(int)\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"unexpected type for calls count: %T\", result)\n\t}\n\n\treturn count, nil\n}\n\nfunc (f *functionLog) Calls() ([]LLMCall, error) {\n\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","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/language_client_go/pkg/rawobjects_function_log.go#L110-L146","documentation":"Calls() retrieves the list of LLM calls from a function log via the 'calls' bridge method. This error wraps any failure of that bridge call itself; note the subsequent unchecked assertion result.([]raw_objects.RawPointer) panics rather than erroring, so the wrapped error here is the only graceful failure path.","triggerScenarios":"Calling FunctionLog.Calls() when the bridge fails to invoke 'calls': disposed runtime object, missing/renamed method, or an exception raised inside the runtime while collecting calls.","commonSituations":"Accessing calls after the function finished and the runtime released the log; runtime version where 'calls' was renamed; transport failure to the runtime process.","solutions":["Inspect the wrapped root error (%w) for the bridge failure reason","Confirm the target runtime exposes the 'calls' method in its current version","Re-fetch the function log object if the backing object may have been disposed"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if flog == nil { return nil, errors.New(\"nil function log\") }","typeGuard":null,"tryCatchPattern":"calls, err := flog.Calls()\nif err != nil {\n    return nil, fmt.Errorf(\"cannot list calls: %w\", err)\n}","preventionTips":["Query calls while the function log is still alive in the runtime","Verify the runtime exposes the 'calls' method in its current version","Re-acquire handles after runtime restarts instead of reusing them"],"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"}