From 9185325c3fec746fd206e5ff1d1892d210ccd04b Mon Sep 17 00:00:00 2001 From: Mitchell Hanberg Date: Sat, 4 Nov 2023 10:49:22 -0400 Subject: [PATCH] fix: clarify errors by handling more clauses --- lib/gen_lsp/communication/stdio.ex | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/gen_lsp/communication/stdio.ex b/lib/gen_lsp/communication/stdio.ex index 50cdcbd..7626daf 100644 --- a/lib/gen_lsp/communication/stdio.ex +++ b/lib/gen_lsp/communication/stdio.ex @@ -5,8 +5,6 @@ defmodule GenLSP.Communication.Stdio do This is the default adapter, and is the communication channel that most LSP clients expect to be able to use. """ - require Logger - @behaviour GenLSP.Communication.Adapter @separator "\r\n\r\n" @@ -43,6 +41,9 @@ defmodule GenLSP.Communication.Stdio do :eof -> :eof + {:error, error} -> + {:error, error} + headers -> body = headers @@ -59,6 +60,9 @@ defmodule GenLSP.Communication.Stdio do :eof -> :eof + {:error, error} -> + {:error, error} + line -> line = String.trim(line) @@ -81,6 +85,9 @@ defmodule GenLSP.Communication.Stdio do :eof -> :eof + {:error, error} -> + {:error, error} + payload -> payload end