We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b18db20 commit 3e45f8cCopy full SHA for 3e45f8c
lib/ruby_lsp/ruby_lsp_rails/runner_client.rb
@@ -61,9 +61,12 @@ def send_message(request, params = nil)
61
def read_response
62
headers = @stdout.gets("\r\n\r\n")
63
raw_response = @stdout.read(T.must(headers)[/Content-Length: (\d+)/i, 1].to_i)
64
- response = JSON.parse(T.must(raw_response), symbolize_names: true)
65
66
- # TODO: handle exception if JSON parse fails?
+ response = begin
+ JSON.parse(T.must(raw_response), symbolize_names: true)
67
+ rescue JSON::ParserError => e
68
+ { error: e.message }
69
+ end
70
71
if response[:error]
72
warn("Ruby LSP Rails error: " + response[:error])
0 commit comments