aboutsummaryrefslogtreecommitdiffstats
path: root/app/History.hs
diff options
context:
space:
mode:
Diffstat (limited to 'app/History.hs')
-rw-r--r--app/History.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/History.hs b/app/History.hs
index a76e97b..c0427fa 100644
--- a/app/History.hs
+++ b/app/History.hs
@@ -11,7 +11,7 @@ import CMark qualified as D
import Cache (cachedMaybe)
import Comment qualified as G
import Control.Arrow (first)
-import Control.Exception (catch, handle, try)
+import Control.Exception (Handler (..), catch, catches, try)
import Data.Binary (Binary)
import Data.ByteString.Lazy qualified as LB
import Data.Digest.Pure.SHA qualified as S
@@ -139,9 +139,12 @@ getIssuesAndFilesChanged commitHash = do
-- | Get all issues in the given directory and file.
getIssuesOfFile :: CommitHash -> FilePath -> IO [I.Issue]
getIssuesOfFile commitHash filename =
- handle (\(_ :: E.UnknownFileExtension) -> pure []) $
- fmap catMaybes . parMapM (fromComment commitHash)
+ ( fmap catMaybes . parMapM (fromComment commitHash)
=<< G.getComments commitHash filename
+ )
+ `catches` [ Handler \(_ :: E.UnknownFile) -> pure [],
+ Handler \(_ :: E.UnsupportedLanguage) -> pure []
+ ]
-- | Note that `provenance` is trivial and needs to be fixed up later.
fromComment :: CommitHash -> G.Comment -> IO (Maybe I.Issue)