mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-11 19:58:28 +01:00
More error information when Haddock unpacking fails
This commit is contained in:
parent
55a5107657
commit
da1b63ba9b
@ -7,6 +7,8 @@ module Data.Unpacking
|
|||||||
, createHoogleDatabases
|
, createHoogleDatabases
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Control.Concurrent.Async
|
||||||
|
import Data.Conduit.Process
|
||||||
import Import hiding (runDB)
|
import Import hiding (runDB)
|
||||||
import Data.BlobStore
|
import Data.BlobStore
|
||||||
import Handler.Haddock
|
import Handler.Haddock
|
||||||
@ -147,13 +149,22 @@ unpackRawDocsTo store ident say destdir =
|
|||||||
|
|
||||||
createTree destdir
|
createTree destdir
|
||||||
say "Unpacking tarball"
|
say "Unpacking tarball"
|
||||||
(Nothing, Nothing, Nothing, ph) <- createProcess
|
(ClosedStream, out, err, cph) <- streamingProcess (proc "tar" ["xf", tempfp])
|
||||||
(proc "tar" ["xf", tempfp])
|
{ cwd = Just $ fpToString destdir
|
||||||
{ cwd = Just $ fpToString destdir
|
}
|
||||||
}
|
(ec, out', err') <- liftIO $ runConcurrently $ (,,)
|
||||||
ec <- waitForProcess ph
|
<$> Concurrently (waitForStreamingProcess cph)
|
||||||
if ec == ExitSuccess then return () else throwM ec
|
<*> Concurrently (out $$ foldC)
|
||||||
|
<*> Concurrently (err $$ foldC)
|
||||||
|
unless (ec == ExitSuccess) $ throwM
|
||||||
|
$ HaddockBundleUnpackException ec out' err'
|
||||||
|
|
||||||
|
data HaddockBundleUnpackException = HaddockBundleUnpackException
|
||||||
|
!ExitCode
|
||||||
|
!ByteString
|
||||||
|
!ByteString
|
||||||
|
deriving (Show, Typeable)
|
||||||
|
instance Exception HaddockBundleUnpackException
|
||||||
|
|
||||||
unpacker
|
unpacker
|
||||||
:: Dirs
|
:: Dirs
|
||||||
|
|||||||
11
Import.hs
11
Import.hs
@ -51,6 +51,11 @@ requireDocs stackageEnt = do
|
|||||||
<p>This page will automatically reload every second.
|
<p>This page will automatically reload every second.
|
||||||
<p>Current status: #{msg}
|
<p>Current status: #{msg}
|
||||||
|]
|
|]
|
||||||
USFailed e -> invalidArgs
|
USFailed e -> do
|
||||||
[ "Docs not available: " ++ e
|
$logWarn $ "Docs not available: " ++ tshow
|
||||||
]
|
( stackageSlug $ entityVal stackageEnt
|
||||||
|
, e
|
||||||
|
)
|
||||||
|
invalidArgs
|
||||||
|
[ "Docs not available: " ++ e
|
||||||
|
]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user