{"record":{"id":"06b344227f094e3f","repo":"egametang/ET","slug":"not-found-handler-message","errorCode":null,"errorMessage":"not found handler: {message}","messagePattern":"not found handler: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"Packages/cn.etetet.lockstep/Scripts/Hotfix/Server/Gate/NetComponentOnReadInvoker_Gate.cs","lineNumber":76,"sourceCode":"                    if (session != null)\n                    {\n                        session.Send(iResponse);\n                    }\n\n                    break;\n                }\n                case IRequest actorRequest: // 分发IActorRequest消息，目前没有用到，需要的自己添加\n                {\n                    break;\n                }\n                case IMessage actorMessage: // 分发IActorMessage消息，目前没有用到，需要的自己添加\n                {\n                    break;\n                }\n\n                default:\n                {\n                    throw new Exception($\"not found handler: {message}\");\n                }\n            }\n        }\n    }\n}","sourceCodeStart":58,"sourceCodeEnd":81,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.lockstep/Scripts/Hotfix/Server/Gate/NetComponentOnReadInvoker_Gate.cs#L58-L81","documentation":"Thrown by the Gate server's message dispatcher (NetComponentOnReadInvoker_Gate) when an incoming message does not match any known case: not ISessionMessage (already handled above the switch), not IRequest, and not IMessage. The default case rejects unregistered message types to prevent silent drops. IRequest and IMessage branches exist but are explicitly no-ops ('currently unused, add yourself if needed').","triggerScenarios":"A client sends a message type that the Gate server's dispatcher switch does not have a case for. Specifically, a message implementing IRequest or IMessage hits the no-op break instead of being dispatched, or a completely unknown message type hits default.","commonSituations":"Adding a new Actor-based message protocol without updating the Gate dispatcher to handle IRequest/IMessage routing. Client and server protocol versions are out of sync. A message was misrouted to the Gate scene that should have gone to a different scene type.","solutions":["Identify the message type from the error and add a proper case + dispatch handler for it in the Gate invoker switch.","If the message should be routed as an Actor request/message, implement the IRequest/IMessage case bodies instead of leaving them as break.","Verify the client is sending the correct message for the scene type it is connected to."],"exampleFix":"// before: IRequest case is a no-op break\ncase IRequest actorRequest:\n{\n    break; // not dispatched\n}\n// after: dispatch it\ncase IRequest actorRequest:\n{\n    MessageSessionDispatcher.Instance.Handle(session, message);\n    break;\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { DispatchMessage(session, message); } catch (Exception e) { Log.Error($\"Gate message dispatch failed for {message?.GetType().Name}: {e}\"); }","preventionTips":["Register handlers for all message types the Gate scene is expected to receive before deploying.","Log unrecognized message types at startup to catch protocol mismatches early in development.","Keep client and server message definitions in a shared assembly to prevent drift."],"tags":["network","gate","message-dispatch","server"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}