{"record":{"id":"65f148625e33e17c","repo":"ory/hydra","slug":"err-error-65f148","errorCode":null,"errorMessage":"err.Error()","messagePattern":"err\\.Error\\(\\)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"fosite/pushed_authorize_response_writer.go","lineNumber":62,"sourceCode":"\treturn resp, nil\n}\n\n// WritePushedAuthorizeResponse writes the PAR response\nfunc (f *Fosite) WritePushedAuthorizeResponse(ctx context.Context, rw http.ResponseWriter, ar AuthorizeRequester, resp PushedAuthorizeResponder) {\n\t// Set custom headers, e.g. \"X-MySuperCoolCustomHeader\" or \"X-DONT-CACHE-ME\"...\n\twh := rw.Header()\n\trh := resp.GetHeader()\n\tfor k := range rh {\n\t\twh.Set(k, rh.Get(k))\n\t}\n\n\twh.Set(\"Cache-Control\", \"no-store\")\n\twh.Set(\"Pragma\", \"no-cache\")\n\twh.Set(\"Content-Type\", \"application/json;charset=UTF-8\")\n\n\tjs, err := json.Marshal(resp.ToMap())\n\tif err != nil {\n\t\thttp.Error(rw, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\trw.Header().Set(\"Content-Type\", \"application/json;charset=UTF-8\")\n\n\trw.WriteHeader(http.StatusCreated)\n\t_, _ = rw.Write(js)\n}\n\n// WritePushedAuthorizeError writes the PAR error\nfunc (f *Fosite) WritePushedAuthorizeError(ctx context.Context, rw http.ResponseWriter, ar AuthorizeRequester, err error) {\n\trw.Header().Set(\"Cache-Control\", \"no-store\")\n\trw.Header().Set(\"Pragma\", \"no-cache\")\n\trw.Header().Set(\"Content-Type\", \"application/json;charset=UTF-8\")\n\n\tsendDebugMessagesToClient := f.Config.GetSendDebugMessagesToClients(ctx)\n\trfcerr := ErrorToRFC6749Error(err).WithLegacyFormat(f.Config.GetUseLegacyErrorFormat(ctx)).\n\t\tWithExposeDebug(sendDebugMessagesToClient).WithLocalizer(f.Config.GetMessageCatalog(ctx), getLangFromRequester(ar))","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/ory/hydra/blob/4174065ffb052799890f7480f5360a877a67ffc1/fosite/pushed_authorize_response_writer.go#L44-L80","documentation":"In WritePushedAuthorizeResponse, this is the fallback branch when json.Marshal of the PAR response map fails: the pushed-authorization-response payload cannot be serialized, and the raw error text is written as an HTTP error. Practically unreachable for map[string]interface{} data, it guards against internal state producing unmarshalable values.","triggerScenarios":"Thrown at fosite/pushed_authorize_response_writer.go:62 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Return a proper 500 server_error JSON body instead of plain-text http.Error","Log the marshal failure with the response map contents for diagnosis","Ensure responder ToMap implementations only return JSON-safe values"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4174065ffb052799890f7480f5360a877a67ffc1","analyzedAt":"2026-09-03T14:52:41.581Z","contentChangedAt":"2026-09-03T14:52:41.581Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}