{"record":{"id":"58a3a71b59557870","repo":"BoundaryML/baml","slug":"failed-to-get-is-base64-w","errorCode":null,"errorMessage":"failed to get is base64: %w","messagePattern":"failed to get is base64: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/language_client_go/pkg/rawobjects_media.go","lineNumber":113,"sourceCode":"\t\treturn nil, fmt.Errorf(\"unexpected type for mime type: %T\", result)\n\t}\n\n\treturn &as_mime_type, nil\n}\n\nfunc (m *mediaHolder) IsUrl() (bool, error) {\n\tresult, err := raw_objects.CallMethod(m, \"is_url\", nil)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"failed to get is url: %w\", err)\n\t}\n\n\treturn result.(bool), nil\n}\n\nfunc (m *mediaHolder) IsBase64() (bool, error) {\n\tresult, err := raw_objects.CallMethod(m, \"is_base64\", nil)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"failed to get is base64: %w\", err)\n\t}\n\n\treturn result.(bool), nil\n}\n\nfunc (m *mediaHolder) AsUrl() (*string, error) {\n\tresult, err := raw_objects.CallMethod(m, \"as_url\", nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get as url: %w\", err)\n\t}\n\n\tif result == nil {\n\t\treturn nil, nil\n\t}\n\n\tas_url, ok := result.(string)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unexpected type for as_url: %T\", result)","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/language_client_go/pkg/rawobjects_media.go#L95-L131","documentation":"Wraps any error from the FFI call to the runtime's `is_base64` method, which reports whether the media content is base64-encoded data. The wrapper preserves the underlying cause with %w, so the wrapped error carries the real failure from the Rust runtime.","triggerScenarios":"Calling IsBase64() on a media object whose CFFI handle is stale/invalid or whose remote `is_base64` method fails in the runtime.","commonSituations":"Long-lived references to media from an earlier LLM call; mismatched Go client and runtime versions; runtime bug or corrupted media payload.","solutions":["Read the wrapped cause via errors.Unwrap to diagnose","Rebuild the media object from a new BAML call result","Upgrade the baml Go module and baml-cli together","Verify the media source (file/URL/base64 string) was well-formed when constructed"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if media == nil { return fmt.Errorf(\"media object is nil\") }","typeGuard":null,"tryCatchPattern":"isB64, err := media.IsBase64()\nif err != nil {\n    log.Printf(\"is_base64 failed: %v\", errors.Unwrap(err))\n    isB64 = false\n}","preventionTips":["Use media objects promptly within the response lifetime","Verify media inputs were well-formed when constructed","Upgrade Go module and runtime together"],"tags":["go","ffi","baml","media"],"backgroundTag":"unexpected-api-response-shape","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"}