show (Timeout lastMsg) =
"Timed out waiting to receive a message from the server." ++
case lastMsg of
- Just msg -> "\nLast message received: " ++ show msg
+ Just msg -> "\nLast message received:\n" ++ B.unpack (encodePretty msg)
Nothing -> mempty
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" ++
- "Last message received: " ++ show lastMsg
+ "Last message received:\n" ++ B.unpack (encodePretty lastMsg)
show (ReplayOutOfOrder received expected) =
let expected' = nub expected
getJsonDiff = lines . B.unpack . encodePretty