diff --git a/src/Vervis/Application.hs b/src/Vervis/Application.hs index a93268d..6f677f0 100644 --- a/src/Vervis/Application.hs +++ b/src/Vervis/Application.hs @@ -32,6 +32,7 @@ where import Control.Concurrent.Chan import Control.Concurrent.STM.TVar +import Control.Exception hiding (Handler) import Control.Monad import Control.Monad.Logger (liftLoc, runLoggingT, logInfo, logError) import Control.Monad.Trans.Reader @@ -229,14 +230,19 @@ makeFoundation appSettings = do verifyRepoDir = do repos <- lift repoTreeFromDir repos' <- repoTreeFromDB - unless (repos == repos') $ - error "Repo dir check failed!" - liftIO $ - for_ repos $ \ (shr, rps) -> - for_ rps $ \ (rp, vcs) -> - putStrLn $ - "Found repo " ++ - shr ++ " / " ++ rp ++ " [" ++ show vcs ++ "]" + unless (repos == repos') $ liftIO $ do + putStrLn "Repo tree based on filesystem:" + printRepos repos + putStrLn "Repo tree based on database:" + printRepos repos' + throwIO $ userError "Repo dir check failed!" + liftIO $ printRepos repos + where + printRepos = traverse_ $ \ (shr, rps) -> + for_ rps $ \ (rp, vcs) -> + putStrLn $ + "Found repo " ++ + shr ++ " / " ++ rp ++ " [" ++ show vcs ++ "]" repoTreeFromDir = do dir <- askRepoRootDir outers <- liftIO $ listDirectory dir