{"record":{"id":"c7494c77be05d016","repo":"microsoft/typescript-go","slug":"jsonrpc-read-content-w","errorCode":null,"errorMessage":"jsonrpc: read content: %w","messagePattern":"jsonrpc: read content: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/jsonrpc/baseproto.go","lineNumber":72,"sourceCode":"\n\t\tif bytes.Equal(key, []byte(\"Content-Length\")) {\n\t\t\tcontentLength, err = strconv.ParseInt(string(bytes.TrimSpace(value)), 10, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"%w: parse error: %w\", ErrInvalidContentLength, err)\n\t\t\t}\n\t\t\tif contentLength < 0 {\n\t\t\t\treturn nil, fmt.Errorf(\"%w: negative value %d\", ErrInvalidContentLength, contentLength)\n\t\t\t}\n\t\t}\n\t}\n\n\tif contentLength <= 0 {\n\t\treturn nil, ErrNoContentLength\n\t}\n\n\tdata := make([]byte, contentLength)\n\tif _, err := io.ReadFull(r.r, data); err != nil {\n\t\treturn nil, fmt.Errorf(\"jsonrpc: read content: %w\", err)\n\t}\n\n\treturn data, nil\n}\n\n// Writer writes JSON-RPC messages with Content-Length framing.\ntype Writer struct {\n\tw *bufio.Writer\n}\n\n// NewWriter creates a new Writer.\nfunc NewWriter(w io.Writer) *Writer {\n\treturn &Writer{\n\t\tw: bufio.NewWriter(w),\n\t}\n}\n\n// Write writes a message payload with Content-Length header.","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/internal/jsonrpc/baseproto.go#L54-L90","documentation":"Error \"jsonrpc: read content: %w\" thrown in microsoft/typescript-go.","triggerScenarios":"Thrown at internal/jsonrpc/baseproto.go:72 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}