handleGHCException :: (Proxy p) => GHC.Ghc () -> Producer p ClientDirective GHC.Ghc Bool
handleGHCException action = runIdentityP $ do
  errM <- lift $ GHC.gcatch (Nothing <$ action) (return . Just . flip GHC.showGhcException "")
  case errM of
    Nothing -> return True
    (Just err) -> do
      respond $ ClientStderr err
      respond $ ClientExit $ ExitFailure 1
      return False
handleGHCException :: (Proxy p) => GHC.Ghc () -> Producer p ClientDirective GHC.Ghc Bool
handleGHCException action = runIdentityP $ do
  errM <- lift $ GHC.gcatch (Nothing <$ action) (return . Just . flip GHC.showGhcException "")
  case errM of
    Nothing -> return True
    (Just err) -> do
      respond $ ClientStderr err
      respond $ ClientExit $ ExitFailure 1
      return False
handleGHCException action = runIdentityP $ do
  errM <- lift $ GHC.gcatch (Nothing <$ action) (return . Just . flip GHC.showGhcException "")
  case errM of
    Nothing -> return True
    (Just err) -> do
      respond $ ClientStderr err
      respond $ ClientExit $ ExitFailure 1
      return False