module Exception ( AnyException (..), InvalidTreeGrepperResult (..), NoCommits (..), ProcessException (..), 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 data AnyException = InvalidTreeGrepperResult' InvalidTreeGrepperResult | NoCommits' NoCommits | ProcessException' ProcessException | UnknownFile' UnknownFile | InvalidDiff' InvalidDiff | InvalidIssue' InvalidIssue | UnsupportedLanguage' UnsupportedLanguage deriving (Show) instance Exception AnyException data InvalidTreeGrepperResult = InvalidTreeGrepperResult { error :: String } deriving (Show) instance Exception InvalidTreeGrepperResult data NoCommits = NoCommits deriving (Show) instance Exception NoCommits data ProcessException = ProcessException String ExitCode LB.ByteString deriving (Show) instance Exception ProcessException data UnknownFile = UnknownFile { filePath :: FilePath } deriving (Show) instance Exception UnknownFile data InvalidDiff = InvalidDiff String deriving (Show) instance Exception InvalidDiff data InvalidIssue = InvalidIssue (P.ParseErrorBundle [D.Node] Void) deriving (Show) instance Exception InvalidIssue data CannotReadFile = CannotReadFile FilePath deriving (Show) instance Exception CannotReadFile data UnsupportedLanguage = UnsupportedLanguage T.Text deriving (Show) instance Exception UnsupportedLanguage