未验证 提交 ef337d30 编写于 作者: P polinasok 提交者: GitHub

service/dap: log stacktrace when panic is recovered (#2457)

上级 35d4f05c
......@@ -21,6 +21,7 @@ import (
"reflect"
"regexp"
"runtime"
"runtime/debug"
"strings"
"sync"
......@@ -318,6 +319,7 @@ func (s *Server) handleRequest(request dap.Message) {
// In case a handler panics, we catch the panic and send an error response
// back to the client.
if ierr := recover(); ierr != nil {
s.log.Errorf("stacktrace from recovered panic:\n%s\n", debug.Stack())
s.sendInternalErrorResponse(request.GetSeq(), fmt.Sprintf("%v", ierr))
}
}()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册