on master help sign in
Improve debugging output (#2281)

* Improve debugging output Displaying the exception makes it easier to figure out what is going wrong. I’ve also added a HasCallStack constraint to `locateRunfiles` since it looked like that was failing. Turned out to be a call to `create` that didn’t go via `locateRunfiles` but I think it’s useful either way. Should be more useful with https://github.com/tweag/rules_haskell/pull/1007 * Update compiler/hie-core/src/Development/IDE/Core/Shake.hs Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>

commit8ab246bcdb31585ab585f55c26ab632a9b368b83 authorMoritz Kiefer <moritz.kiefer@purelyfunctional.org> dateThu 25 Jul 2019, 12:33 (7 years ago) parente41f17c
1 file changed+4−2
src/Development/IDE/Core/Shake.hs+4−2
src/Development/IDE/Core/Shake.hs+4−2
@@ -50,7 +50,6 @@ import qualified Data.ByteString.Char8 as BS
5050import Data.Dynamic
5151import Data.Maybe
5252import Data.Map.Strict (Map)
53−import Data.Either.Extra
5453import Data.List.Extra
5554import qualified Data.Set as Set
5655import qualified Data.Text as T
@@ -340,8 +339,11 @@ shakeRun IdeState{shakeExtras=ShakeExtras{..}, ..} acts = modifyVar shakeAbort $
340339 thread <- forkFinally (shakeRunDatabaseProfile shakeDb acts) $ \res -> do
341340 signalBarrier bar res
342341 runTime <- start
342+ let res' = case res of
343+ Left e -> "exception: " <> displayException e
344+ Right _ -> "completed"
343345 logDebug logger $ T.pack $
344− "Finishing shakeRun (took " ++ showDuration runTime ++ ", " ++ (if isLeft res then "exception" else "completed") ++ ")"
346+ "Finishing shakeRun (took " ++ showDuration runTime ++ ", " ++ res' ++ ")"
345347 -- important: we send an async exception to the thread, then wait for it to die, before continuing
346348 return (do killThread thread; void $ waitBarrier bar, either throwIO return =<< waitBarrier bar)
347349