Exception.hs 891 B

1234567891011121314151617181920212223
  1. {-# LANGUAGE DeriveDataTypeable #-}
  2. module Database.Persist.Redis.Exception
  3. ( RedisException (..)
  4. ) where
  5. import Control.Exception (Exception)
  6. import Data.Typeable (Typeable)
  7. data RedisException = NotSupportedOperation String
  8. | ParserError String
  9. | NotSupportedValueType String
  10. | IncorrectUpdate String
  11. | IncorrectBehavior
  12. deriving Typeable
  13. instance Show RedisException where
  14. show (NotSupportedOperation key) = "The operation is not supported: " ++ key
  15. show (ParserError msg) = "Error during parsing: " ++ msg
  16. show (NotSupportedValueType tp) = "The value type " ++ tp ++ " is not supported for Redis"
  17. show IncorrectBehavior = "The behavior of persistent-redis is incorrect"
  18. show (IncorrectUpdate msg) = "This update is not possible: " ++ msg
  19. instance Exception RedisException