aboutsummaryrefslogtreecommitdiffstats
path: root/app/Exception.hs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2023-10-17 14:14:48 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2023-11-07 09:50:51 +0100
commitea1236f2cf6d3ef4b739b2ca28f47a3bbed42295 (patch)
tree3b1801ad9654e657ed0c0b202e316dc42244c56d /app/Exception.hs
parent4521eb7a4b0d4a4ff8cf9153484d0596c5143170 (diff)
refactor history
Diffstat (limited to 'app/Exception.hs')
-rw-r--r--app/Exception.hs38
1 files changed, 38 insertions, 0 deletions
diff --git a/app/Exception.hs b/app/Exception.hs
new file mode 100644
index 0000000..83d624d
--- /dev/null
+++ b/app/Exception.hs
@@ -0,0 +1,38 @@
+module Exception
+ ( AnyException (..),
+ InvalidTreeGrepperResult (..),
+ ProcessException (..),
+ UnknownFileExtension (..),
+ )
+where
+
+import Control.Exception
+import Data.ByteString.Lazy.Char8 as LB
+import System.Exit (ExitCode)
+
+data AnyException
+ = InvalidTreeGrepperResult' InvalidTreeGrepperResult
+ | ProcessException' ProcessException
+ | UnknownFileExtension' UnknownFileExtension
+ deriving (Show)
+
+instance Exception AnyException
+
+data InvalidTreeGrepperResult = InvalidTreeGrepperResult
+ { error :: String
+ }
+ deriving (Show)
+
+instance Exception InvalidTreeGrepperResult
+
+data ProcessException = ProcessException String ExitCode LB.ByteString
+ deriving (Show)
+
+instance Exception ProcessException
+
+data UnknownFileExtension = UnknownFileExtension
+ { extension :: String
+ }
+ deriving (Show)
+
+instance Exception UnknownFileExtension