{"record":{"id":"0ef77807b9fb5ad8","repo":"ory/hydra","slug":"server-error-0ef778","errorCode":"server_error","errorMessage":"{\"error\":\"server_error\",\"error_description\":\"%s\"}","messagePattern":"\\{\"error\":\"server_error\",\"error_description\":\"%s\"\\}","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"fosite/pushed_authorize_response_writer.go","lineNumber":86,"sourceCode":"\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))\n\n\tjs, err := json.Marshal(rfcerr)\n\tif err != nil {\n\t\tif sendDebugMessagesToClient {\n\t\t\terrorMessage := EscapeJSONString(err.Error())\n\t\t\thttp.Error(rw, fmt.Sprintf(`{\"error\":\"server_error\",\"error_description\":\"%s\"}`, errorMessage), http.StatusInternalServerError)\n\t\t} else {\n\t\t\thttp.Error(rw, `{\"error\":\"server_error\"}`, http.StatusInternalServerError)\n\t\t}\n\t\treturn\n\t}\n\n\trw.WriteHeader(rfcerr.CodeField)\n\t_, _ = rw.Write(js)\n}\n","sourceCodeStart":68,"sourceCodeEnd":96,"githubUrl":"https://github.com/ory/hydra/blob/4174065ffb052799890f7480f5360a877a67ffc1/fosite/pushed_authorize_response_writer.go#L68-L96","documentation":"In WritePushedAuthorizeError, this format string renders the non-debug fallback body for a PAR error: a JSON server_error whose error_description is filled only when debug messages are exposed to clients, otherwise a generic message is sent. It fires when writing the RFC6749-mapped error for a failed pushed-authorize request.","triggerScenarios":"Thrown at fosite/pushed_authorize_response_writer.go:86 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep sendDebugMessagesToClient disabled in production so internals are not leaked","Map underlying errors to specific RFC6749 error codes before they reach this writer","Log the full error server-side while returning the generic description to the client"],"exampleFix":null,"handlingStrategy":"fallback","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"}