-- |
-- Module      : Git.Stale.Types.Error
-- License     : BSD3
-- Maintainer  : tbidne@gmail.com
-- Provides `Err` type for describing any errors encountered.
module Git.Stale.Types.Error
  ( Err (..),
    ErrOr,
  )
where

import qualified Data.Text as T

-- | Wraps `T.Text` to describe an error. @Git*@ errors describe errors
-- encountered by the underlying `Core.MonadFindBranches.MonadFindBranches`
-- monad. Others describe pure errors encountered during parsing data returned
-- by the monad.
data Err
  = ParseLog T.Text
  | ParseDate T.Text
  | ParseName T.Text
  | ParseMerge T.Text
  | ReadInt T.Text
  | GitBranches T.Text
  | GitLog T.Text
  deriving (Int -> Err -> ShowS
[Err] -> ShowS
Err -> String
(Int -> Err -> ShowS)
-> (Err -> String) -> ([Err] -> ShowS) -> Show Err
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Err] -> ShowS
$cshowList :: [Err] -> ShowS
show :: Err -> String
$cshow :: Err -> String
showsPrec :: Int -> Err -> ShowS
$cshowsPrec :: Int -> Err -> ShowS
Show)

-- | Alias for convenience.
type ErrOr a = Either Err a