Skip to content

Commit 36e3d96

Browse files
adonovangopherbot
authored andcommitted
gopls/internal/protocol: remove obsolete recoverHandlerPanic
It has been a no-op for some while. Updates golang/go#74652 Change-Id: Ic81b8030176c16f194a466ac561b9974288bf9d3 Reviewed-on: https://go-review.googlesource.com/c/tools/+/691315 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Robert Findley <[email protected]> Auto-Submit: Alan Donovan <[email protected]>
1 parent c8d5607 commit 36e3d96

File tree

4 files changed

+0
-19
lines changed

4 files changed

+0
-19
lines changed

gopls/internal/protocol/generate/main.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ func writeclient() {
105105
}
106106
out.WriteString("}\n\n")
107107
out.WriteString(`func clientDispatch(ctx context.Context, client Client, reply jsonrpc2.Replier, r jsonrpc2.Request) (bool, error) {
108-
defer recoverHandlerPanic(r.Method())
109108
switch r.Method() {
110109
`)
111110
for _, k := range ccases.keys() {
@@ -136,7 +135,6 @@ func writeserver() {
136135
}
137136
138137
func serverDispatch(ctx context.Context, server Server, reply jsonrpc2.Replier, r jsonrpc2.Request) (bool, error) {
139-
defer recoverHandlerPanic(r.Method())
140138
switch r.Method() {
141139
`)
142140
for _, k := range scases.keys() {

gopls/internal/protocol/protocol.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"fmt"
1212
"io"
1313

14-
"golang.org/x/tools/gopls/internal/util/bug"
1514
"golang.org/x/tools/internal/event"
1615
"golang.org/x/tools/internal/jsonrpc2"
1716
jsonrpc2_v2 "golang.org/x/tools/internal/jsonrpc2_v2"
@@ -296,17 +295,3 @@ func NonNilSlice[T comparable](x []T) []T {
296295
}
297296
return x
298297
}
299-
300-
func recoverHandlerPanic(method string) {
301-
// Report panics in the handler goroutine,
302-
// unless we have enabled the monitor,
303-
// which reports all crashes.
304-
if !true {
305-
defer func() {
306-
if x := recover(); x != nil {
307-
bug.Reportf("panic in %s request", method)
308-
panic(x)
309-
}
310-
}()
311-
}
312-
}

gopls/internal/protocol/tsclient.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gopls/internal/protocol/tsserver.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)