From 5f6b015cc8488a8cd74a9e32c3306dc5677331b0 Mon Sep 17 00:00:00 2001 From: Mikolaj Konarski Date: Sat, 13 Sep 2014 23:27:33 +0200 Subject: [PATCH] We again build documentation in case of proper source errors (#253) and only refuse building it in case of "GHC server died (dummy error)". We are in no position to decide if partial documentation should be built or not. Let the user of our API decide --- he has access to all relevant information, in particular, to errors. --- IdeSession/Update/ExecuteSessionUpdate.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/IdeSession/Update/ExecuteSessionUpdate.hs b/IdeSession/Update/ExecuteSessionUpdate.hs index a66d3a5..da5108b 100644 --- a/IdeSession/Update/ExecuteSessionUpdate.hs +++ b/IdeSession/Update/ExecuteSessionUpdate.hs @@ -702,11 +702,14 @@ executeBuildDoc = do Nothing -> error "This session state does not admit artifact generation." Just Computed{computedErrors} -> toLazyList computedErrors + isDummyError err = + errorKind err == KindError + && errorMsg err == Text.pack "GHC server died (dummy error)" exitCode <- - if any (== KindError) $ map errorKind errors then do + if any isDummyError errors then do exceptionFree $ do writeFile beStderrLog - "Source or other errors encountered. Not attempting to build documentation." + "GHC server died. Not attempting to build documentation." return $ ExitFailure 1 else exceptionFree $ do (loadedMs, pkgs) <- buildDeps mcomputed