Skip to content

Commit 5ed8a87

Browse files
committed
Fix handler - either an error or success
1 parent 429e5ea commit 5ed8a87

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: ghcide/src/Development/IDE/LSP/LanguageServer.hs

+4-2
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,11 @@ runLanguageServer options inH outH getHieDbLoc defaultConfig onConfigurationChan
141141
logInfo (ideLogger ide) $ T.pack $ "Registering ide configuration: " <> show initConfig
142142
registerIdeConfiguration (shakeExtras ide) initConfig
143143

144-
let handleServerException e = do
145-
logError (ideLogger ide) (T.pack $ "Unexpected exception in server thread: " <> show e)
144+
let handleServerException (Left e) = do
145+
logError (ideLogger ide) $
146+
T.pack $ "Fatal error in server thread: " <> show e
146147
exitClientMsg
148+
handleServerException _ = pure ()
147149
_ <- flip forkFinally handleServerException $ runWithDb dbLoc $ \hiedb hieChan -> do
148150
putMVar dbMVar (hiedb,hieChan)
149151
forever $ do

0 commit comments

Comments
 (0)