@@ -1029,10 +1029,10 @@ getDocsNonInteractive' name =
1029
1029
-- | Non-interactive modification of 'GHC.Runtime.Eval.getDocs'.
1030
1030
-- The interactive paths create problems in ghc-lib builds
1031
1031
--- and lead to fun errors like "Cannot continue after interface file error".
1032
- getDocsNonInteractive :: HscEnv -> Module -> Name -> IO (Either ErrorMessages ( Name , Either GetDocsFailure (Maybe HsDocString , Maybe (Map. Map Int HsDocString ) )))
1032
+ getDocsNonInteractive :: HscEnv -> Module -> Name -> IO (Name , Either GetDocsFailure (Maybe HsDocString , Maybe (Map. Map Int HsDocString )))
1033
1033
getDocsNonInteractive hsc_env mod name = do
1034
1034
((_warns,errs), res) <- initTypecheckEnv hsc_env mod $ getDocsNonInteractive' name
1035
- pure $ maybeToEither errs res
1035
+ maybe (liftIO . throwIO . mkSrcErr $ errs) pure res
1036
1036
1037
1037
1038
1038
-- | Non-interactive, batch version of 'GHC.Runtime.Eval.getDocs'.
@@ -1041,11 +1041,11 @@ getDocsBatch
1041
1041
-> Module -- ^ a moudle where the names are in scope
1042
1042
-> [Name ]
1043
1043
-- 2021-11-18: NOTE: Map Int would become IntMap if next GHCs.
1044
- -> IO (Either ErrorMessages ( Map. Map Name (Either GetDocsFailure (Maybe HsDocString , Maybe (Map. Map Int HsDocString ) ))))
1044
+ -> IO (Map. Map Name (Either GetDocsFailure (Maybe HsDocString , Maybe (Map. Map Int HsDocString ))))
1045
1045
-- ^ Return a 'Map' of 'Name's to 'Either' (no docs messages) (general doc body & arg docs)
1046
1046
getDocsBatch hsc_env mod names = do
1047
1047
((_warns,errs), res) <- initTypecheckEnv hsc_env mod $ Map. fromList <$> traverse getDocsNonInteractive' names
1048
- pure $ maybeToEither errs res
1048
+ maybe (liftIO . throwIO . mkSrcErr $ errs) pure res
1049
1049
1050
1050
-- | Non-interactive, batch version of 'InteractiveEval.lookupNames'.
1051
1051
-- The interactive paths create problems in ghc-lib builds
0 commit comments