mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-03 05:23:25 +03:00
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>
This commit is contained in:
parent
e41f17c969
commit
8ab246bcdb
@ -50,7 +50,6 @@ import qualified Data.ByteString.Char8 as BS
|
||||
import Data.Dynamic
|
||||
import Data.Maybe
|
||||
import Data.Map.Strict (Map)
|
||||
import Data.Either.Extra
|
||||
import Data.List.Extra
|
||||
import qualified Data.Set as Set
|
||||
import qualified Data.Text as T
|
||||
@ -340,8 +339,11 @@ shakeRun IdeState{shakeExtras=ShakeExtras{..}, ..} acts = modifyVar shakeAbort $
|
||||
thread <- forkFinally (shakeRunDatabaseProfile shakeDb acts) $ \res -> do
|
||||
signalBarrier bar res
|
||||
runTime <- start
|
||||
let res' = case res of
|
||||
Left e -> "exception: " <> displayException e
|
||||
Right _ -> "completed"
|
||||
logDebug logger $ T.pack $
|
||||
"Finishing shakeRun (took " ++ showDuration runTime ++ ", " ++ (if isLeft res then "exception" else "completed") ++ ")"
|
||||
"Finishing shakeRun (took " ++ showDuration runTime ++ ", " ++ res' ++ ")"
|
||||
-- important: we send an async exception to the thread, then wait for it to die, before continuing
|
||||
return (do killThread thread; void $ waitBarrier bar, either throwIO return =<< waitBarrier bar)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user