{"record":{"id":"4503247a2eed453f","repo":"microsoft/typescript-go","slug":"32603-450324","errorCode":"-32603","errorMessage":"panic: %v\\n%s","messagePattern":"panic: (.+?)\\\\n(.+?)","errorType":"exception","errorClass":"jsonrpc.ResponseError","httpStatus":null,"severity":"error","filePath":"internal/api/conn_sync.go","lineNumber":121,"sourceCode":"\t\tif writeErr != nil {\n\t\t\tpanic(fmt.Sprintf(\"api: failed to write reset server timing response: %v\", writeErr))\n\t\t}\n\t\treturn\n\t}\n\n\tvar result any\n\tvar err error\n\n\tstart := time.Time{}\n\tif c.timing != nil {\n\t\tstart = time.Now()\n\t}\n\n\t// Recover from panics and convert to error response with stack trace\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tstack := string(debug.Stack())\n\t\t\terr = fmt.Errorf(\"panic: %v\\n%s\", r, stack)\n\n\t\t\tc.mu.Lock()\n\t\t\twriteErr := c.protocol.WriteError(msg.ID, &jsonrpc.ResponseError{\n\t\t\t\tCode:    jsonrpc.CodeInternalError,\n\t\t\t\tMessage: err.Error(),\n\t\t\t})\n\t\t\tc.mu.Unlock()\n\n\t\t\tif writeErr != nil {\n\t\t\t\tpanic(fmt.Sprintf(\"api: failed to write panic error response: %v (original panic: %v)\", writeErr, r))\n\t\t\t}\n\t\t}\n\t}()\n\n\tresult, err = c.handler.HandleRequest(ctx, msg.Method, msg.Params)\n\n\tif c.timing != nil {\n\t\tc.timing.record(msg.Method, time.Since(start))","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/internal/api/conn_sync.go#L103-L139","documentation":"The synchronous connection's request dispatcher recovers panics from handlers and converts them into a JSON-RPC error response with code -32603, including the panic value and Go stack trace — the SyncConn twin of the async path (error 94).","triggerScenarios":"Any panic while dispatching a request in the sync server loop: nil map/slice access, assertion failures, invariant violations in a method implementation.","commonSituations":"Server regressions after upgrades, malformed params that pass parsing but break assumptions, uninitialized optional components (timing, FS callbacks).","solutions":["Locate the fault using the embedded stack trace and report or patch it","Update to a fixed server build","Avoid the triggering request/params until fixed","Check server stderr for preceding warnings that hint at the root cause"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"result, err := conn.Call(ctx, method, params)\nif err != nil && strings.Contains(err.Error(), \"panic:\") {\n    // internal server panic surfaced as -32603: capture stack from message, update/report\n}","preventionTips":["Always read the stack trace embedded in the message before guessing","Pin known-good server versions in CI","Report reproducible panics with the triggering request payload"],"tags":["json-rpc","go","panic","internal-error"],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}