{"record":{"id":"1919b04b83608874","repo":"yudai/gotty","slug":"unknown-message-type-c","errorCode":null,"errorMessage":"unknown message type `%c`","messagePattern":"unknown message type `%c`","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"webtty/webtty.go","lineNumber":210,"sourceCode":"\n\t\tvar args argResizeTerminal\n\t\terr := json.Unmarshal(data[1:], &args)\n\t\tif err != nil {\n\t\t\treturn errors.Wrapf(err, \"received malformed data for terminal resize\")\n\t\t}\n\t\trows := wt.rows\n\t\tif rows == 0 {\n\t\t\trows = int(args.Rows)\n\t\t}\n\n\t\tcolumns := wt.columns\n\t\tif columns == 0 {\n\t\t\tcolumns = int(args.Columns)\n\t\t}\n\n\t\twt.slave.ResizeTerminal(columns, rows)\n\tdefault:\n\t\treturn errors.Errorf(\"unknown message type `%c`\", data[0])\n\t}\n\n\treturn nil\n}\n\ntype argResizeTerminal struct {\n\tColumns float64\n\tRows    float64\n}\n","sourceCodeStart":192,"sourceCodeEnd":220,"githubUrl":"https://github.com/yudai/gotty/blob/a080c85cbc59226c94c6941ad8c395232d72d517/webtty/webtty.go#L192-L220","documentation":"Default-branch guard in handleMasterReadEvent: the first byte of a master message does not match any known protocol message type (input '0', ping '1', resize '2'), so the frame is treated as an unknown/protocol-violating message and the read loop errors out, killing the session.","triggerScenarios":"Thrown at webtty/webtty.go:210 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the client prefixes every frame with the correct protocol byte","Upgrade mismatched client/server pairs sharing the websocket","Log the offending byte to identify which client implementation is misbehaving"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a080c85cbc59226c94c6941ad8c395232d72d517","analyzedAt":"2026-09-02T16:42:38.150Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}