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

import qualified Data.Text as T

import GHC.Generics

import TextShow
import qualified TextShow.Generic as TSG

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, (forall x. CommandError -> Rep CommandError x)
-> (forall x. Rep CommandError x -> CommandError)
-> Generic CommandError
forall x. Rep CommandError x -> CommandError
forall x. CommandError -> Rep CommandError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CommandError x -> CommandError
$cfrom :: forall x. CommandError -> Rep CommandError x
Generic)
    deriving (Int -> CommandError -> Text
Int -> CommandError -> Text
Int -> CommandError -> Builder
[CommandError] -> Text
[CommandError] -> Text
[CommandError] -> Builder
CommandError -> Text
CommandError -> Text
CommandError -> Builder
(Int -> CommandError -> Builder)
-> (CommandError -> Builder)
-> ([CommandError] -> Builder)
-> (Int -> CommandError -> Text)
-> (CommandError -> Text)
-> ([CommandError] -> Text)
-> (Int -> CommandError -> Text)
-> (CommandError -> Text)
-> ([CommandError] -> Text)
-> TextShow CommandError
forall a.
(Int -> a -> Builder)
-> (a -> Builder)
-> ([a] -> Builder)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> TextShow a
showtlList :: [CommandError] -> Text
$cshowtlList :: [CommandError] -> Text
showtl :: CommandError -> Text
$cshowtl :: CommandError -> Text
showtlPrec :: Int -> CommandError -> Text
$cshowtlPrec :: Int -> CommandError -> Text
showtList :: [CommandError] -> Text
$cshowtList :: [CommandError] -> Text
showt :: CommandError -> Text
$cshowt :: CommandError -> Text
showtPrec :: Int -> CommandError -> Text
$cshowtPrec :: Int -> CommandError -> Text
showbList :: [CommandError] -> Builder
$cshowbList :: [CommandError] -> Builder
showb :: CommandError -> Builder
$cshowb :: CommandError -> Builder
showbPrec :: Int -> CommandError -> Builder
$cshowbPrec :: Int -> CommandError -> Builder
TextShow) via TSG.FromGeneric CommandError