Use a SessionException instead an error, to ignore the error when server is down
[lsp-test.git] / 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