Add new NoContentLengthHeader SessionException to replace raw error
authorjneira <atreyu.bbb@gmail.com>
Tue, 9 Jul 2019 12:35:04 +0000 (14:35 +0200)
committerjneira <atreyu.bbb@gmail.com>
Tue, 9 Jul 2019 12:35:04 +0000 (14:35 +0200)
src/Language/Haskell/LSP/Test/Exceptions.hs

index b1e0635e31b435b6a8e480e19b83b43fdab6802b..dd31ea3cc155d879ba5366966b04e9b4ca5a4808 100644 (file)
@@ -12,6 +12,7 @@ import qualified Data.ByteString.Lazy.Char8 as B
 
 -- | An exception that can be thrown during a 'Haskell.LSP.Test.Session.Session'
 data SessionException = Timeout
+                      | NoContentLengthHeader
                       | UnexpectedMessage String FromServerMessage
                       | ReplayOutOfOrder FromServerMessage [FromServerMessage]
                       | UnexpectedDiagnostics
@@ -24,6 +25,7 @@ instance Exception SessionException
 
 instance Show SessionException where
   show Timeout = "Timed out waiting to receive a message from the server."
+  show NoContentLengthHeader = "Couldn't read Content-Length header from the server."
   show (UnexpectedMessage expected lastMsg) =
     "Received an unexpected message from the server:\n" ++
     "Was parsing: " ++ expected ++ "\n" ++