{"record":{"id":"9159ef97bae4ef3c","repo":"BoundaryML/baml","slug":"failed-to-get-id-w-rawobjects-http-request","errorCode":null,"errorMessage":"failed to get ID: %w","messagePattern":"failed to get ID: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/language_client_go/pkg/rawobjects_http_request.go","lineNumber":30,"sourceCode":"\t*raw_objects.RawObject\n}\n\nfunc newHttpRequest(ptr int64, rt unsafe.Pointer) HTTPRequest {\n\treturn &httpRequest{raw_objects.FromPointer(ptr, rt)}\n}\n\nfunc (h *httpRequest) ObjectType() cffi.BamlObjectType {\n\treturn cffi.BamlObjectType_OBJECT_HTTP_REQUEST\n}\n\nfunc (h *httpRequest) pointer() int64 {\n\treturn h.RawObject.Pointer()\n}\n\nfunc (h *httpRequest) 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 *httpRequest) Url() (string, error) {\n\tresult, err := raw_objects.CallMethod(h, \"url\", nil)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to get URL: %w\", err)\n\t}\n\n\turl, ok := result.(string)\n\tif !ok {","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/language_client_go/pkg/rawobjects_http_request.go#L12-L48","documentation":"httpRequest.RequestId() invokes the underlying runtime object's 'id' method through the raw-objects bridge. The 'failed to get ID' wrapper means the bridge call itself failed before a value was returned — the runtime object could not execute its 'id' method.","triggerScenarios":"Calling RequestId() on an httpRequest whose backing raw object is invalid, detached, or lacks a working 'id' method; the runtime method raises an exception during execution.","commonSituations":"Reusing a request object after the script/runtime was torn down; building requests manually instead of through the library's dispatch pipeline; version drift where the runtime object no longer exposes 'id'.","solutions":["Ensure the httpRequest came from the library's dispatch/API pipeline, not manual construction","Inspect the wrapped cause (%w) for the underlying bridge failure","Verify the runtime/script version matches the Go client version","Re-dispatch the request to obtain a fresh object"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if req == nil { return errors.New(\"request unavailable\") }","typeGuard":"func (h *httpRequest) hasID() bool { return h != nil && h.RawObject != nil && h.RawObject.Pointer() != 0 }","tryCatchPattern":"id, err := req.RequestId()\nif err != nil {\n    return fmt.Errorf(\"request has no ID: %w\", err)\n}","preventionTips":["Only use request objects returned by the library's dispatch pipeline","Do not hold request references after the runtime context closes","Keep Go client and runtime versions in sync"],"tags":["go","runtime-bridge","request-id"],"backgroundTag":"method-not-implemented","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}