BoundaryML/baml · error
failed to get calls: %w
Error message
failed to get calls: %w
What it means
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.
Source
Thrown at engine/language_client_go/pkg/rawobjects_function_log.go:128
func (f *functionLog) CallsCount() (int, error) {
result, err := raw_objects.CallMethod(f, "calls_count", nil)
if err != nil {
return 0, fmt.Errorf("failed to get calls count: %w", err)
}
count, ok := result.(int)
if !ok {
return 0, fmt.Errorf("unexpected type for calls count: %T", result)
}
return count, nil
}
func (f *functionLog) Calls() ([]LLMCall, error) {
result, err := raw_objects.CallMethod(f, "calls", nil)
if err != nil {
return nil, fmt.Errorf("failed to get calls: %w", err)
}
result_cast := result.([]raw_objects.RawPointer)
calls := make([]LLMCall, len(result_cast))
for i, call := range result_cast {
calls[i] = call.(LLMCall)
}
return calls, nil
}
func (f *functionLog) SelectedCall() (LLMCall, error) {
result, err := raw_objects.CallMethod(f, "selected_call", nil)
if err != nil {
return nil, fmt.Errorf("failed to get selected call: %w", err)
}
View on GitHub (pinned to bd85ce9dee)
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
Defensive patterns
Strategy: try-catch
Validate before calling
if flog == nil { return nil, errors.New("nil function log") } Try / catch
calls, err := flog.Calls()
if err != nil {
return nil, fmt.Errorf("cannot list calls: %w", err)
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: Accessing calls after the function finished and the runtime released the log; runtime version where 'calls' was renamed; transport failure to the runtime process.
Understand the failure class
Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.
Related errors
- failed to get calls count: %w
- failed to get selected call: %w
- failed to get tags: %w
- unexpected type for raw LLM response: %T
- failed to get text: %w
AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12).
Data as JSON: /api/errors/86afcb9bf8db759c.
Report an issue: GitHub.