Use a SessionException instead an error, to ignore the error when server is down
authorjneira <atreyu.bbb@gmail.com>
Tue, 9 Jul 2019 12:36:35 +0000 (14:36 +0200)
committerjneira <atreyu.bbb@gmail.com>
Tue, 9 Jul 2019 12:36:35 +0000 (14:36 +0200)
src/Language/Haskell/LSP/Test/Decoding.hs

index 27c7770ec461cdebe16a17868419b440f986081a..af91928695d73df098cb4054abaae82632d3a845 100644 (file)
@@ -32,7 +32,7 @@ getNextMessage :: Handle -> IO B.ByteString
 getNextMessage h = do
   headers <- getHeaders h
   case read . init <$> lookup "Content-Length" headers of
-    Nothing   -> error "Couldn't read Content-Length header"
+    Nothing   -> throw NoContentLengthHeader
     Just size -> B.hGet h size
 
 addHeader :: B.ByteString -> B.ByteString