module Hercules.UserException where
import Control.Exception (Exception (displayException))
import Data.Monoid ((<>))
import Data.Text (Text)
import qualified Data.Text as T
import Prelude (Show (..))
data UserException = UserException Text
instance Exception UserException where
displayException :: UserException -> String
displayException = UserException -> String
forall a. Show a => a -> String
show
instance Show UserException where
show :: UserException -> String
show (UserException Text
msg) = String
"error: " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> Text -> String
T.unpack Text
msg