1 module Language.Haskell.LSP.Test.Exceptions where
3 import Control.Exception
4 import Language.Haskell.LSP.Messages
6 data SessionException = TimeoutException
7 | UnexpectedMessageException String FromServerMessage
9 instance Exception SessionException
11 instance Show SessionException where
12 show TimeoutException = "Timed out waiting to receive a message from the server."
13 show (UnexpectedMessageException expected lastMsg) =
14 "Received an unexpected message from the server:\n" ++
15 "Expected: " ++ expected ++ "\n" ++
16 "Last message accepted: " ++ show lastMsg
18 anySessionException :: SessionException -> Bool
19 anySessionException = const True