BoundaryML/baml · error

failed to get tags: %w

Error message

failed to get tags: %w

What it means

Tags() fetches the function log's tags map via the 'tags' bridge method. This error wraps any failure of the bridge call itself (disposed object, missing method, runtime exception), separate from the map type-assertion error raised immediately after.

Source

Thrown at engine/language_client_go/pkg/rawobjects_function_log.go:158

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)
	}

	call, ok := result.(LLMCall)
	if !ok {
		return nil, fmt.Errorf("unexpected type for selected call: %T", result)
	}

	return call, nil
}

func (f *functionLog) Tags() (map[string]any, error) {
	result, err := raw_objects.CallMethod(f, "tags", nil)
	if err != nil {
		return nil, fmt.Errorf("failed to get tags: %w", err)
	}

	tags, ok := result.(map[string]any)
	if !ok {
		return nil, fmt.Errorf("unexpected type for tags: %T", result)
	}

	return tags, nil
}

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Inspect the wrapped root error for the bridge failure
  2. Verify the runtime still exposes 'tags'
  3. Re-acquire a fresh function log handle
Defensive patterns

Strategy: try-catch

Validate before calling

if flog == nil { return nil, errors.New("nil function log") }

Try / catch

tags, err := flog.Tags()
if err != nil {
    return nil, fmt.Errorf("tags unavailable: %w", err)
}

Prevention

When it happens

Trigger: Calling FunctionLog.Tags() when the bridge fails to invoke 'tags' on the runtime object.

Common situations: Accessing tags after the function log's backing object was released; runtime version where 'tags' was renamed or removed; transport/IPC failure.

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


AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12). Data as JSON: /api/errors/a1aa97c6a1d4a2b4. Report an issue: GitHub.