{"record":{"id":"d1a45cccb398624c","repo":"egametang/ET","slug":"not-found-response-type-request-type-request-fu","errorCode":null,"errorMessage":"not found response type, request type: {request.FullName}","messagePattern":"not found response type, request type: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"Packages/cn.etetet.core/Scripts/Core/Share/Network/OpcodeType.cs","lineNumber":83,"sourceCode":"            }\n            return opcode;\n        }\n\n        public Type GetType(ushort opcode)\n        {\n            Type type = this.typeOpcode.GetKeyByValue(opcode);\n            if (type == null)\n            {\n                throw new Exception($\"OpcodeType not found type: {opcode}\");\n            }\n            return type;\n        }\n\n        public Type GetResponseType(Type request)\n        {\n            if (!this.requestResponse.TryGetValue(request, out Type response))\n            {\n                throw new Exception($\"not found response type, request type: {request.FullName}\");\n            }\n\n            return response;\n        }\n    }\n}\n","sourceCodeStart":65,"sourceCodeEnd":90,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.core/Scripts/Core/Share/Network/OpcodeType.cs#L65-L90","documentation":"OpcodeType.GetResponseType maps a request type to its response type via the requestResponse dictionary built from [ResponseType] attributes. It throws when a request has no recorded response type, meaning the attribute is missing or the named response type was not generated/loaded.","triggerScenarios":"Calling an RPC whose request class lacks [ResponseType(\"XxxResponse\")], or where the ET.XxxResponse type referenced by the attribute does not exist.","commonSituations":"New request added without the ResponseType attribute, response type renamed without updating the attribute, or the response assembly not loaded.","solutions":["Add [ResponseType(nameof(XxxResponse))] to the request message.","Regenerate protocol files so the response type and attribute are emitted.","Ensure the response type exists in a scanned assembly."],"exampleFix":"// before\n[Message(...)] public class XxxRequest { ... } // no response\n// after\n[ResponseType(nameof(XxxResponse))]\n[Message(...)] public class XxxRequest { ... }","handlingStrategy":"validation","validationCode":"var respAttr = request.GetCustomAttribute<ResponseTypeAttribute>();\nif (respAttr == null) throw new InvalidOperationException($\"{request} missing [ResponseType]\");\nType resp = OpcodeType.Instance.GetResponseType(request);","typeGuard":"public bool HasResponseType(Type req) => requestResponse.ContainsKey(req);","tryCatchPattern":"null","preventionTips":["Always pair a request with [ResponseType(nameof(Response))].","Regenerate protocol so both request and response exist.","Static-check request types at startup."],"tags":["network","serialization","rpc","csharp"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}