{"record":{"id":"e74c0bf7e8f51a40","repo":"BoundaryML/baml","slug":"failed-to-get-method-w","errorCode":null,"errorMessage":"failed to get method: %w","messagePattern":"failed to get method: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/language_client_go/pkg/rawobjects_http_request.go","lineNumber":58,"sourceCode":"\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 {\n\t\treturn \"\", fmt.Errorf(\"unexpected type for URL: %T\", result)\n\t}\n\n\treturn url, nil\n}\n\nfunc (h *httpRequest) Method() (string, error) {\n\tresult, err := raw_objects.CallMethod(h, \"method\", nil)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to get method: %w\", err)\n\t}\n\n\tmethod, ok := result.(string)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"unexpected type for method: %T\", result)\n\t}\n\n\treturn method, nil\n}\n\nfunc (h *httpRequest) 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":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/language_client_go/pkg/rawobjects_http_request.go#L40-L76","documentation":"httpRequest.Method() invokes the runtime object's 'method' via the raw-objects bridge. 'failed to get method: %w' indicates the bridge call itself failed, so the HTTP method could not be read from the underlying object.","triggerScenarios":"Calling Method() on an invalid/detached request object, or when the runtime 'method' implementation raises an exception.","commonSituations":"Accessing request data after script teardown; runtime handlers panicking on method lookup; mismatched client/runtime versions.","solutions":["Inspect the wrapped cause (%w)","Use the request only during its dispatch lifecycle","Confirm the runtime object defines 'method'","Re-dispatch to obtain a fresh request"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if req == nil { return errors.New(\"request unavailable\") }","typeGuard":"func (h *httpRequest) hasMethod() bool { return h != nil && h.RawObject != nil }","tryCatchPattern":"m, err := req.Method()\nif err != nil {\n    return fmt.Errorf(\"cannot read HTTP method: %w\", err)\n}","preventionTips":["Use request objects within their dispatch lifecycle","Ensure the runtime sets an explicit string method","Keep versions in sync"],"tags":["go","runtime-bridge","http-method"],"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"}