packages feed

amqp 0.14.0 → 0.14.1

raw patch · 3 files changed

+11/−7 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

Network/AMQP/Internal.hs view
@@ -215,7 +215,7 @@ -- | Opens a connection to a broker specified by the given 'ConnectionOpts' parameter.
 openConnection'' :: ConnectionOpts -> IO Connection
 openConnection'' connOpts = withSocketsDo $ do
-    handle <- connect $ coServers connOpts
+    handle <- connect [] $ coServers connOpts
     (maxFrameSize, maxChannel, heartbeatTimeout) <- CE.handle (\(_ :: CE.IOException) -> CE.throwIO $ ConnectionClosedException "Handshake failed. Please check the RabbitMQ logs for more information") $ do
         Conn.connectionPut handle $ BS.append (BC.pack "AMQP")
                 (BS.pack [
@@ -299,7 +299,7 @@ 
     return conn
   where
-    connect ((host, port) : rest) = do
+    connect excs ((host, port) : rest) = do
         ctx <- Conn.initConnectionContext
         result <- CE.try (Conn.connectTo ctx $ Conn.ConnectionParams
                               { Conn.connectionHostname  = host
@@ -309,10 +309,10 @@                               })
         either
             (\(ex :: CE.SomeException) -> do
-                connect rest)
+                connect (ex:excs) rest)
             (return)
             result
-    connect [] = CE.throwIO $ ConnectionClosedException $ "Could not connect to any of the provided brokers: " ++ show (coServers connOpts)
+    connect excs [] = CE.throwIO $ ConnectionClosedException $ "Could not connect to any of the provided brokers: " ++ show (zip (coServers connOpts) (reverse excs))
     tlsSettings = maybe Nothing connectionTLSSettings (coTLSSettings connOpts)
     selectSASLMechanism handle serverMechanisms =
         let serverSaslList = T.split (== ' ') $ E.decodeUtf8 serverMechanisms
amqp.cabal view
@@ -1,5 +1,5 @@ Name:                amqp
-Version:             0.14.0
+Version:             0.14.1
 Synopsis:            Client library for AMQP servers (currently only RabbitMQ)
 Description:         Client library for AMQP servers (currently only RabbitMQ)
 License:             BSD3
changelog.md view
@@ -1,3 +1,7 @@+### Version 0.14.1
+
+* show all exceptions if no host can be connected to
+
 ### Version 0.14.0
 
 * publishMsg now returns the message sequence-number
@@ -71,7 +75,7 @@ 
 ### Version 0.4.3
 
-* use Handles instead of sockets 
+* use Handles instead of sockets
 * fix deprecation warnings from Data.Binary
 
 ### Version 0.4.2
@@ -88,4 +92,4 @@ * the field-types in Network.AMQP.Types should now be more compatible with RabbitMQ
 * hostnames passed to openConnection will now be resolved
 * basic QoS support
-* exceptions thrown in a callback will not erroneously close the channel anymore+* exceptions thrown in a callback will not erroneously close the channel anymore