aboutsummaryrefslogtreecommitdiffstats
path: root/app/Exception.hs
diff options
context:
space:
mode:
Diffstat (limited to 'app/Exception.hs')
-rw-r--r--app/Exception.hs18
1 files changed, 13 insertions, 5 deletions
diff --git a/app/Exception.hs b/app/Exception.hs
index 5428194..db7612b 100644
--- a/app/Exception.hs
+++ b/app/Exception.hs
@@ -3,16 +3,18 @@ module Exception
InvalidTreeGrepperResult (..),
NoCommits (..),
ProcessException (..),
- UnknownFileExtension (..),
+ UnknownFile (..),
InvalidDiff (..),
InvalidIssue (..),
CannotReadFile (..),
+ UnsupportedLanguage (..),
)
where
import CMark qualified as D
import Control.Exception
import Data.ByteString.Lazy.Char8 as LB
+import Data.Text qualified as T
import Data.Void (Void)
import System.Exit (ExitCode)
import Text.Megaparsec qualified as P
@@ -21,9 +23,10 @@ data AnyException
= InvalidTreeGrepperResult' InvalidTreeGrepperResult
| NoCommits' NoCommits
| ProcessException' ProcessException
- | UnknownFileExtension' UnknownFileExtension
+ | UnknownFile' UnknownFile
| InvalidDiff' InvalidDiff
| InvalidIssue' InvalidIssue
+ | UnsupportedLanguage' UnsupportedLanguage
deriving (Show)
instance Exception AnyException
@@ -45,12 +48,12 @@ data ProcessException = ProcessException String ExitCode LB.ByteString
instance Exception ProcessException
-data UnknownFileExtension = UnknownFileExtension
- { extension :: String
+data UnknownFile = UnknownFile
+ { filePath :: FilePath
}
deriving (Show)
-instance Exception UnknownFileExtension
+instance Exception UnknownFile
data InvalidDiff = InvalidDiff String
deriving (Show)
@@ -66,3 +69,8 @@ data CannotReadFile = CannotReadFile FilePath
deriving (Show)
instance Exception CannotReadFile
+
+data UnsupportedLanguage = UnsupportedLanguage T.Text
+ deriving (Show)
+
+instance Exception UnsupportedLanguage