module System.XDG.Error where

import           Control.Exception


data XDGError
  = FileNotFound FilePath
  | NoReadableFile
  | MissingEnv String
  deriving (XDGError -> XDGError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: XDGError -> XDGError -> Bool
$c/= :: XDGError -> XDGError -> Bool
== :: XDGError -> XDGError -> Bool
$c== :: XDGError -> XDGError -> Bool
Eq, Int -> XDGError -> ShowS
[XDGError] -> ShowS
XDGError -> FilePath
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
showList :: [XDGError] -> ShowS
$cshowList :: [XDGError] -> ShowS
show :: XDGError -> FilePath
$cshow :: XDGError -> FilePath
showsPrec :: Int -> XDGError -> ShowS
$cshowsPrec :: Int -> XDGError -> ShowS
Show)

instance Exception XDGError


throwIOLeft :: Exception e => Either e a -> IO a
throwIOLeft :: forall e a. Exception e => Either e a -> IO a
throwIOLeft = forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either forall e a. Exception e => e -> IO a
throwIO forall (f :: * -> *) a. Applicative f => a -> f a
pure