{-# LANGUAGE TemplateHaskell #-}

-- | Command errors
module CalamityCommands.Error (CommandError (..)) where

import qualified Data.Text as T
import TextShow.TH (deriveTextShow)

data CommandError
  = ParseError
      T.Text
      -- ^ The type of the parser
      T.Text
      -- ^ The reason that parsing failed
  | CheckError
      T.Text
      -- ^ The name of the check that failed
      T.Text
      -- ^ The reason for the check failing
  | InvokeError
      T.Text
      -- ^ The name of the command that failed
      T.Text
      -- ^ The reason for failing
  deriving (Int -> CommandError -> ShowS
[CommandError] -> ShowS
CommandError -> String
(Int -> CommandError -> ShowS)
-> (CommandError -> String)
-> ([CommandError] -> ShowS)
-> Show CommandError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CommandError] -> ShowS
$cshowList :: [CommandError] -> ShowS
show :: CommandError -> String
$cshow :: CommandError -> String
showsPrec :: Int -> CommandError -> ShowS
$cshowsPrec :: Int -> CommandError -> ShowS
Show)

$(deriveTextShow ''CommandError)