Browse Source

pretty print unpickle errors in error messages

master
Philipp Balzarek 13 years ago
parent
commit
bec4490efb
  1. 8
      source/Network/Xmpp/Stream.hs

8
source/Network/Xmpp/Stream.hs

@ -60,7 +60,8 @@ streamUnpickleElem :: PU [Node] a
-> StreamSink a -> StreamSink a
streamUnpickleElem p x = do streamUnpickleElem p x = do
case unpickleElem p x of case unpickleElem p x of
Left l -> throwError $ XmppOtherFailure "Unpickle error" Left l -> throwError $ XmppOtherFailure ("Unpickle error"
++ ppUnpickleError l)
-- TODO: Log: StreamXmlError (show l) -- TODO: Log: StreamXmlError (show l)
Right r -> return r Right r -> return r
@ -356,8 +357,9 @@ pullUnpickle p = do
Right elem' -> do Right elem' -> do
let res = unpickleElem p elem' let res = unpickleElem p elem'
case res of case res of
Left e -> return . Left $ XmppOtherFailure Left e -> return . Left . XmppOtherFailure $
"pullUnpickle: unpickle failed" -- TODO: Log "pullUnpickle: unpickle failed" ++ ppUnpickleError e
-- TODO: Log
Right r -> return $ Right r Right r -> return $ Right r
-- | Pulls a stanza (or stream error) from the stream. -- | Pulls a stanza (or stream error) from the stream.

Loading…
Cancel
Save