mirror of
https://github.com/ilyakooo0/docker-hs.git
synced 2024-10-26 10:58:14 +03:00
Fixes Unix socket handler
Makes it so that it returns an Either as the defaultHttpHandler does.
This commit is contained in:
parent
fbe6e5b2e4
commit
9c6141317e
@ -93,7 +93,12 @@ unixHttpHandler fp request= do
|
||||
let mSettings = defaultManagerSettings
|
||||
{ managerRawConnection = return $ openUnixSocket fp}
|
||||
manager <- newManager mSettings
|
||||
httpLbs request manager
|
||||
try (httpLbs request manager) >>= \res -> case res of
|
||||
Right res -> return $ Right res
|
||||
Left HTTP.FailedConnectionException{} -> return $ Left DockerConnectionError
|
||||
Left HTTP.FailedConnectionException2{} -> return $ Left DockerConnectionError
|
||||
Left e -> return $ Left $ GenericDockerError (T.pack $ show e)
|
||||
|
||||
where
|
||||
openUnixSocket filePath _ _ _ = do
|
||||
s <- S.socket S.AF_UNIX S.Stream S.defaultProtocol
|
||||
|
Loading…
Reference in New Issue
Block a user