{"record":{"id":"e60af7927bbb5570","repo":"ory/hydra","slug":"error-s","errorCode":null,"errorMessage":"{\"error\": \"%s\"}","messagePattern":"\\{\"error\": \"%s\"\\}","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"fosite/revoke_handler.go","lineNumber":102,"sourceCode":"// Note: invalid tokens do not cause an error response since the client\n// cannot handle such an error in a reasonable way.  Moreover, the\n// purpose of the revocation request, invalidating the particular token,\n// is already achieved.\nfunc (f *Fosite) WriteRevocationResponse(ctx context.Context, rw http.ResponseWriter, err error) {\n\trw.Header().Set(\"Cache-Control\", \"no-store\")\n\trw.Header().Set(\"Pragma\", \"no-cache\")\n\n\tif err == nil {\n\t\trw.WriteHeader(http.StatusOK)\n\t\treturn\n\t}\n\n\tif errors.Is(err, ErrInvalidRequest) {\n\t\trw.Header().Set(\"Content-Type\", \"application/json;charset=UTF-8\")\n\n\t\tjs, err := json.Marshal(ErrInvalidRequest)\n\t\tif err != nil {\n\t\t\thttp.Error(rw, fmt.Sprintf(`{\"error\": \"%s\"}`, err.Error()), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\n\t\trw.WriteHeader(ErrInvalidRequest.CodeField)\n\t\t_, _ = rw.Write(js)\n\t} else if errors.Is(err, ErrInvalidClient) {\n\t\trw.Header().Set(\"Content-Type\", \"application/json;charset=UTF-8\")\n\n\t\tjs, err := json.Marshal(ErrInvalidClient)\n\t\tif err != nil {\n\t\t\thttp.Error(rw, fmt.Sprintf(`{\"error\": \"%s\"}`, err.Error()), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\n\t\trw.WriteHeader(ErrInvalidClient.CodeField)\n\t\t_, _ = rw.Write(js)\n\t} else {\n\t\t// 200 OK","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/ory/hydra/blob/4174065ffb052799890f7480f5360a877a67ffc1/fosite/revoke_handler.go#L84-L120","documentation":"In WriteRevocationResponse, this format renders the JSON body for a revocation error: {\"error\": \"%s\"} with the RFC6749 error code. Per RFC 7009, invalid tokens intentionally do not reach this path (they yield 200); only malformed requests or server errors produce this body, with the specific code chosen by error type.","triggerScenarios":"Thrown at fosite/revoke_handler.go:102 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Return 200 for invalid/unrecognized tokens per RFC 7009 section 2.2","Map errors to proper RFC6749 codes (unsupported_token_type, invalid_request, server_error)","Ensure no token-identifying information leaks in the error body"],"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"}