Skip to content

Commit

Permalink
Fix handler - either an error or success
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Apr 3, 2021
1 parent 429e5ea commit 5ed8a87
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ghcide/src/Development/IDE/LSP/LanguageServer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ runLanguageServer options inH outH getHieDbLoc defaultConfig onConfigurationChan
logInfo (ideLogger ide) $ T.pack $ "Registering ide configuration: " <> show initConfig
registerIdeConfiguration (shakeExtras ide) initConfig

let handleServerException e = do
logError (ideLogger ide) (T.pack $ "Unexpected exception in server thread: " <> show e)
let handleServerException (Left e) = do
logError (ideLogger ide) $
T.pack $ "Fatal error in server thread: " <> show e
exitClientMsg
handleServerException _ = pure ()
_ <- flip forkFinally handleServerException $ runWithDb dbLoc $ \hiedb hieChan -> do
putMVar dbMVar (hiedb,hieChan)
forever $ do
Expand Down

0 comments on commit 5ed8a87

Please sign in to comment.