{"record":{"id":"2a42e0b096a33f79","repo":"BoundaryML/baml","slug":"failed-to-get-status-w","errorCode":null,"errorMessage":"failed to get status: %w","messagePattern":"failed to get status: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/language_client_go/pkg/rawobjects_http_response.go","lineNumber":44,"sourceCode":"\nfunc (h *httpResponse) RequestId() (string, error) {\n\tresult, err := raw_objects.CallMethod(h, \"id\", nil)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to get id: %w\", err)\n\t}\n\n\tid, ok := result.(string)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"unexpected type for id: %T\", result)\n\t}\n\n\treturn id, nil\n}\n\nfunc (h *httpResponse) Status() (int64, error) {\n\tresult, err := raw_objects.CallMethod(h, \"status\", nil)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to get status: %w\", err)\n\t}\n\n\tstatus, ok := result.(int64)\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"unexpected type for status: %T\", result)\n\t}\n\n\treturn status, nil\n}\n\nfunc (h *httpResponse) Headers() (map[string]string, error) {\n\tresult, err := raw_objects.CallMethod(h, \"headers\", nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get headers: %w\", err)\n\t}\n\n\theaders, ok := result.(map[string]string)\n\tif !ok {","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/language_client_go/pkg/rawobjects_http_response.go#L26-L62","documentation":"Thrown by httpResponse.Status() in BAML's Go client when raw_objects.CallMethod(h, \"status\") fails at the FFI boundary; the underlying core error is wrapped with %w. It means the \"status\" method could not be invoked on the raw response object, not that the status value is wrong.","triggerScenarios":"Calling HTTPResponse.Status() on a raw object handle that the core cannot resolve or that does not support the \"status\" method — e.g. stale pointer, object from a torn-down runtime, or bindings/core version drift renaming the method.","commonSituations":"Accessing response metadata in BAML callback/event-log handlers after the runtime released objects; mixing binding versions after an upgrade.","solutions":["Unwrap the error to inspect the core-side cause (errors.Unwrap)","Re-obtain the HTTPResponse from the current runtime rather than a cached/stale handle","Align Go bindings and BAML core versions","Guard callers so a status-lookup failure does not abort the whole flow (default to 0 and log)"],"exampleFix":"status, err := resp.Status()\nif err != nil {\n    log.Printf(\"status unavailable: %v\", err)\n    status = 0 // proceed without status instead of crashing the pipeline\n}","handlingStrategy":"fallback","validationCode":"if resp == nil { return errors.New(\"nil HTTPResponse\") }","typeGuard":null,"tryCatchPattern":"status, err := resp.Status()\nif err != nil {\n    log.Printf(\"status lookup failed: %v\", err)\n    status = 0\n}","preventionTips":["Default to 0/unknown status on lookup failure instead of aborting","Avoid stale raw object handles","Keep engine and Go bindings version-aligned"],"tags":["go","ffi","baml","method-call"],"backgroundTag":"api-request-failed","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}