@@ -52,12 +52,12 @@ type Response = HTTP.Response BL.ByteString
52type HttpVerb = StdMethod
52type HttpVerb = StdMethod
53newtype HttpHandler m = HttpHandler (forall a . Request -> (HTTP.Response () -> Sink BSC.ByteString m (Either DockerError a)) -> m (Either DockerError a))
53newtype HttpHandler m = HttpHandler (forall a . Request -> (HTTP.Response () -> Sink BSC.ByteString m (Either DockerError a)) -> m (Either DockerError a))
55−data DockerError = DockerConnectionError
55+data DockerError = DockerConnectionError NHS.HttpException
56 | DockerInvalidRequest Endpoint
56 | DockerInvalidRequest Endpoint
57 | DockerClientError Text
57 | DockerClientError Text
58 | DockerClientDecodeError Text -- ^ Could not parse the response from the Docker endpoint.
58 | DockerClientDecodeError Text -- ^ Could not parse the response from the Docker endpoint.
59 | DockerInvalidStatusCode HTTP.Status -- ^ Invalid exit code received from Docker endpoint.
59 | DockerInvalidStatusCode HTTP.Status -- ^ Invalid exit code received from Docker endpoint.
60− | GenericDockerError Text deriving (Eq, Show, Typeable)
60+ | GenericDockerError Text deriving (Show, Typeable)
62newtype DockerT m a = DockerT {
62newtype DockerT m a = DockerT {
63 unDockerT :: Monad m => ReaderT (DockerClientOpts, HttpHandler m) m a
63 unDockerT :: Monad m => ReaderT (DockerClientOpts, HttpHandler m) m a
@@ -114,8 +114,8 @@ httpHandler manager = HttpHandler $ \request' sink -> do -- runResourceT ..
114 let request = NHS.setRequestManager manager request'
114 let request = NHS.setRequestManager manager request'
115 try (NHS.httpSink request sink) >>= \res -> case res of
115 try (NHS.httpSink request sink) >>= \res -> case res of
116 Right res -> return res
116 Right res -> return res
117− Left HTTP.FailedConnectionException{} -> return $ Left DockerConnectionError
117+ Left e@HTTP.FailedConnectionException{} -> return $ Left $ DockerConnectionError e
118− Left HTTP.FailedConnectionException2{} -> return $ Left DockerConnectionError
118+ Left e@HTTP.FailedConnectionException2{} -> return $ Left $ DockerConnectionError e
119 Left e -> return $ Left $ GenericDockerError (T.pack $ show e)
119 Left e -> return $ Left $ GenericDockerError (T.pack $ show e)
121-- | Connect to a unix domain socket (the default docker socket is
121-- | Connect to a unix domain socket (the default docker socket is